Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[native] Reduce numer of http requests for Exchange #23097

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,6 @@ void PrestoExchangeSource::processDataResponse(

if (complete) {
abortResults();
} else if (!empty) {
// Acknowledge results for non-empty content.
acknowledgeResults(ackSequence);
}
}

Expand Down Expand Up @@ -422,6 +419,15 @@ void PrestoExchangeSource::processDataError(
}
}

void PrestoExchangeSource::pause() {
int64_t ackSequence;
{
std::lock_guard<std::mutex> l(queue_->mutex());
ackSequence = sequence_;
}
acknowledgeResults(ackSequence);
}

void PrestoExchangeSource::acknowledgeResults(int64_t ackSequence) {
auto ackPath = fmt::format("{}/{}/acknowledge", basePath_, ackSequence);
VLOG(1) << "Sending ack " << ackPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ class PrestoExchangeSource : public velox::exec::ExchangeSource {
return request(0, maxWait);
}

void pause() override;

// Create an exchange source using pooled connections.
static std::shared_ptr<PrestoExchangeSource> create(
const std::string& url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ SystemConfig::SystemConfig() {
NUM_PROP(kAnnouncementMaxFrequencyMs, 30'000), // 30s
NUM_PROP(kHeartbeatFrequencyMs, 0),
STR_PROP(kExchangeMaxErrorDuration, "3m"),
STR_PROP(kExchangeRequestTimeout, "10s"),
STR_PROP(kExchangeRequestTimeout, "20s"),
STR_PROP(kExchangeConnectTimeout, "20s"),
BOOL_PROP(kExchangeEnableConnectionPool, true),
BOOL_PROP(kExchangeEnableBufferCopy, true),
Expand Down
2 changes: 1 addition & 1 deletion presto-native-execution/velox
Submodule velox updated 74 files
+6 −0 velox/common/base/tests/StatsReporterTest.cpp
+13 −7 velox/common/caching/AsyncDataCache.cpp
+2 −2 velox/common/caching/AsyncDataCache.h
+35 −17 velox/common/caching/tests/AsyncDataCacheTest.cpp
+2 −2 velox/common/caching/tests/CachedFactoryTest.cpp
+5 −1 velox/common/file/File.cpp
+3 −1 velox/common/file/File.h
+5 −3 velox/common/memory/Allocation.h
+100 −92 velox/common/memory/HashStringAllocator.cpp
+116 −30 velox/common/memory/HashStringAllocator.h
+1 −4 velox/common/memory/MemoryPool.h
+26 −0 velox/common/memory/tests/HashStringAllocatorTest.cpp
+1 −1 velox/common/process/Profiler.cpp
+1 −1 velox/common/process/Profiler.h
+6 −2 velox/connectors/hive/storage_adapters/abfs/AbfsFileSystem.cpp
+1 −1 velox/connectors/hive/storage_adapters/abfs/AbfsReadFile.h
+4 −2 velox/connectors/hive/storage_adapters/abfs/tests/AbfsFileSystemTest.cpp
+63 −0 velox/docs/develop/testing/async-data-cache-fuzzer.rst
+3 −0 velox/docs/functions/presto/aggregate.rst
+15 −1 velox/docs/functions/presto/string.rst
+38 −1 velox/docs/functions/spark/array.rst
+15 −0 velox/docs/functions/spark/map.rst
+26 −21 velox/dwio/common/tests/TestBufferedInput.cpp
+3 −2 velox/dwio/parquet/reader/PageReader.cpp
+ velox/dwio/parquet/tests/examples/empty_v2datapage.parquet
+56 −42 velox/dwio/parquet/tests/reader/ParquetReaderTest.cpp
+1 −0 velox/dwio/parquet/tests/reader/ParquetTableScanTest.cpp
+12 −0 velox/exec/ExchangeClient.cpp
+1 −1 velox/exec/ExchangeClient.h
+6 −0 velox/exec/ExchangeSource.h
+14 −3 velox/exec/GroupingSet.cpp
+1 −1 velox/exec/OutputBuffer.cpp
+5 −0 velox/exec/fuzzer/CMakeLists.txt
+364 −0 velox/exec/fuzzer/CacheFuzzer.cpp
+24 −0 velox/exec/fuzzer/CacheFuzzer.h
+45 −0 velox/exec/fuzzer/CacheFuzzerRunner.h
+5 −3 velox/exec/fuzzer/MemoryArbitrationFuzzer.cpp
+6 −0 velox/exec/fuzzer/WindowFuzzer.cpp
+1 −1 velox/exec/tests/AggregationTest.cpp
+6 −0 velox/exec/tests/CMakeLists.txt
+44 −0 velox/exec/tests/CacheFuzzerTest.cpp
+157 −20 velox/exec/tests/ExchangeClientTest.cpp
+1 −3 velox/exec/tests/OrderByTest.cpp
+1 −3 velox/exec/tests/SortBufferTest.cpp
+14 −4 velox/exec/tests/utils/LocalExchangeSource.cpp
+12 −1 velox/exec/tests/utils/OperatorTestBase.cpp
+1 −0 velox/experimental/wave/exec/tests/AggregationTest.cpp
+1 −0 velox/experimental/wave/exec/tests/FilterProjectTest.cpp
+1 −1 velox/experimental/wave/exec/tests/TableScanTest.cpp
+1 −0 velox/expression/fuzzer/ExpressionFuzzerTest.cpp
+12 −14 velox/functions/prestosql/BinaryFunctions.h
+1 −0 velox/functions/prestosql/CMakeLists.txt
+7 −0 velox/functions/prestosql/DateTimeFunctions.h
+68 −0 velox/functions/prestosql/GreatestLeast.h
+81 −0 velox/functions/prestosql/SplitToMap.cpp
+95 −31 velox/functions/prestosql/SplitToMap.h
+36 −0 velox/functions/prestosql/StringFunctions.h
+117 −6 velox/functions/prestosql/aggregates/ApproxMostFrequentAggregate.cpp
+21 −41 velox/functions/prestosql/aggregates/ApproxPercentileAggregate.cpp
+100 −0 velox/functions/prestosql/aggregates/tests/ApproxMostFrequentTest.cpp
+3 −5 velox/functions/prestosql/aggregates/tests/ApproxPercentileTest.cpp
+4 −0 velox/functions/prestosql/registration/BinaryFunctionsRegistration.cpp
+6 −0 velox/functions/prestosql/registration/DateTimeFunctionsRegistration.cpp
+12 −0 velox/functions/prestosql/registration/GeneralFunctionsRegistration.cpp
+47 −6 velox/functions/prestosql/registration/StringFunctionsRegistration.cpp
+20 −3 velox/functions/prestosql/tests/BinaryFunctionsTest.cpp
+40 −0 velox/functions/prestosql/tests/DateTimeFunctionsTest.cpp
+37 −0 velox/functions/prestosql/tests/GreatestLeastTest.cpp
+5 −0 velox/functions/prestosql/tests/ScalarFunctionRegTest.cpp
+36 −0 velox/functions/prestosql/tests/SplitToMapTest.cpp
+48 −0 velox/functions/prestosql/tests/StringFunctionsTest.cpp
+12 −0 velox/functions/sparksql/In.cpp
+5 −0 velox/functions/sparksql/Register.cpp
+2 −0 velox/functions/sparksql/tests/InTest.cpp
Loading