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

Feature Branch: merge master to planner_refactory #5493

Merged
merged 31 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c2e9f96
build: Fix build under intel mac machine (#5447)
JaySon-Huang Jul 21, 2022
f11c6c4
fix TiFlash wait index timeout due to not replicated filtered command…
CalvinNeo Jul 21, 2022
6a8c26c
feat: implement hexInt/hexStr function push down (#5280)
YangKeao Jul 22, 2022
3ad743b
*: try not to use lld as default linker in macos (#5451)
solotzg Jul 22, 2022
c823138
fix: incorrect uptime in grafana panel (#5358)
Lloyd-Pottiger Jul 25, 2022
e289119
fix sched_setaffinity failed. (#5459)
JinheLin Jul 25, 2022
da32955
feat: support 'bin' function push down (#5246)
An-DJ Jul 25, 2022
679eda6
Support colllation for planner refactory test framework (#5449)
xzhangxian1008 Jul 26, 2022
a476307
refine `InterpreterDAG` (#5466)
SeaRise Jul 26, 2022
c4ad3f1
fix hexInt `sprintf` format pattern (#5460)
YangKeao Jul 26, 2022
53e2c42
Fix typo of Metrics (#5472)
JinheLin Jul 27, 2022
28d3991
refine FlashService (#5471)
ywqzzy Jul 27, 2022
e5f0eb4
*: improve RUNTIME_CHECK and RUNTIME_ASSERT (#5434)
fuzhe1989 Jul 27, 2022
ee2f753
refine Window Executor Test (#5464)
SeaRise Jul 27, 2022
72f7481
Add metrics of Read Thread and Cache (#5476)
JinheLin Jul 27, 2022
245e2fb
bugfix for core of GRPCCompQueue when tiflash shutdown (#5483)
bestwoody Jul 27, 2022
ad5201c
test: Add tests case when deltaMergeBySplit + { flushCache | split } …
breezewish Jul 27, 2022
bcb029e
Design doc: DeltaTree Read Thread Pool and Data Sharing (#5478)
JinheLin Jul 28, 2022
5c54e9c
*: Simplify join executor translation (#5453)
Willendless Jul 29, 2022
f6f7b0f
Fix RegionEpoch Error and CheckWaitIndex takes too long (#5498)
CalvinNeo Jul 29, 2022
b4ee52e
test: Simplify comparing the stream read result (#5435)
JaySon-Huang Jul 29, 2022
ccf1854
fix the schema version error in sync schema when latest schema diff i…
hongyunyan Jul 29, 2022
a89526c
*: Refine the ExchangeReceiverResult (#5494)
JaySon-Huang Jul 29, 2022
eef9e22
Add benchmark for collation (#5491)
xzhangxian1008 Jul 31, 2022
bebd45a
*: Combine LOG_XXX and LOG_FMT_XXX (#5512)
fuzhe1989 Aug 2, 2022
4972cf3
*: decouple FlashGrpcServerHolder from Server.cpp (#5516)
ywqzzy Aug 2, 2022
30fc64c
Optimize expression `LIKE() ESCAPE()` for bin collator (#5489)
solotzg Aug 2, 2022
1022499
fix wrong path for BlobStat under multi-disks env (#5520)
lidezhu Aug 2, 2022
3153a3b
Test: Mock TiFlash compute service and dispatch MPPTask to single ser…
ywqzzy Aug 3, 2022
45088e9
merge master to planner_refactory
SeaRise Aug 3, 2022
120214f
open License checker for planner_refactory
SeaRise Aug 3, 2022
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ endif()
find_program (LLD_PATH NAMES "lld${COMPILER_POSTFIX}" "lld")
find_program (GOLD_PATH NAMES "gold")

if (NOT LINKER_NAME)
if (NOT LINKER_NAME AND NOT APPLE)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND LLD_PATH)
set (LINKER_NAME "lld")
elseif (GOLD_PATH)
Expand Down
2 changes: 1 addition & 1 deletion contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ SET (BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable google-benchmark testi
add_subdirectory(benchmark)

set (BUILD_TESTING OFF CACHE BOOL "Disable cpu-features testing" FORCE)
if ((NOT APPLE) AND (NOT ARCH_AARCH64))
if (NOT (APPLE AND ARCH_AARCH64))
add_subdirectory(cpu_features)
endif()

Expand Down
2 changes: 1 addition & 1 deletion contrib/googletest
Submodule googletest updated 250 files
2 changes: 2 additions & 0 deletions dbms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ include(${TiFlash_SOURCE_DIR}/cmake/dbms_glob_sources.cmake)

add_headers_and_sources(clickhouse_common_io src/Common)
add_headers_and_sources(clickhouse_common_io src/Common/HashTable)
add_headers_and_sources(clickhouse_common_io src/Common/SyncPoint)
add_headers_and_sources(clickhouse_common_io src/IO)

add_headers_and_sources(dbms src/Analyzers)
Expand Down Expand Up @@ -272,6 +273,7 @@ if (ENABLE_TESTS)
include (${TiFlash_SOURCE_DIR}/cmake/find_gtest.cmake)

if (USE_INTERNAL_GTEST_LIBRARY)
set(INSTALL_GTEST OFF)
# Google Test from sources
add_subdirectory(${TiFlash_SOURCE_DIR}/contrib/googletest/googletest ${CMAKE_CURRENT_BINARY_DIR}/googletest)
# avoid problems with <regexp.h>
Expand Down
53 changes: 34 additions & 19 deletions dbms/src/Common/Exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <errno.h>
#include <string.h>


namespace DB
{
namespace ErrorCodes
Expand All @@ -35,7 +34,6 @@ extern const int UNKNOWN_EXCEPTION;
extern const int CANNOT_TRUNCATE_FILE;
} // namespace ErrorCodes


void throwFromErrno(const std::string & s, int code, int e)
{
const size_t buf_size = 128;
Expand All @@ -54,14 +52,18 @@ void throwFromErrno(const std::string & s, int code, int e)
strcpy(buf, unknown_message);
strcpy(buf + strlen(unknown_message), code);
}
throw ErrnoException(s + ", errno: " + toString(e) + ", strerror: " + std::string(buf), code, e);
throw ErrnoException(s + ", errno: " + toString(e) + ", strerror: " + std::string(buf),
code,
e);
#else
throw ErrnoException(s + ", errno: " + toString(e) + ", strerror: " + std::string(strerror_r(e, buf, sizeof(buf))), code, e);
throw ErrnoException(s + ", errno: " + toString(e) + ", strerror: " + std::string(strerror_r(e, buf, sizeof(buf))),
code,
e);
#endif
}


void tryLogCurrentException(const char * log_name, const std::string & start_of_message)
void tryLogCurrentException(const char * log_name,
const std::string & start_of_message)
{
tryLogCurrentException(&Poco::Logger::get(log_name), start_of_message);
}
Expand All @@ -75,19 +77,22 @@ void tryLogCurrentException(const char * log_name, const std::string & start_of_
{ \
}

void tryLogCurrentException(const LoggerPtr & logger, const std::string & start_of_message)
void tryLogCurrentException(const LoggerPtr & logger,
const std::string & start_of_message)
{
TRY_LOG_CURRENT_EXCEPTION(logger, start_of_message);
}

void tryLogCurrentException(Poco::Logger * logger, const std::string & start_of_message)
void tryLogCurrentException(Poco::Logger * logger,
const std::string & start_of_message)
{
TRY_LOG_CURRENT_EXCEPTION(logger, start_of_message);
}

#undef TRY_LOG_CURRENT_EXCEPTION

std::string getCurrentExceptionMessage(bool with_stacktrace, bool check_embedded_stacktrace)
std::string getCurrentExceptionMessage(bool with_stacktrace,
bool check_embedded_stacktrace)
{
std::stringstream stream;

Expand All @@ -103,8 +108,10 @@ std::string getCurrentExceptionMessage(bool with_stacktrace, bool check_embedded
{
try
{
stream << "Poco::Exception. Code: " << ErrorCodes::POCO_EXCEPTION << ", e.code() = " << e.code()
<< ", e.displayText() = " << e.displayText() << ", e.what() = " << e.what();
stream << "Poco::Exception. Code: " << ErrorCodes::POCO_EXCEPTION
<< ", e.code() = " << e.code()
<< ", e.displayText() = " << e.displayText()
<< ", e.what() = " << e.what();
}
catch (...)
{
Expand All @@ -120,7 +127,8 @@ std::string getCurrentExceptionMessage(bool with_stacktrace, bool check_embedded
if (status)
name += " (demangling status: " + toString(status) + ")";

stream << "std::exception. Code: " << ErrorCodes::STD_EXCEPTION << ", type: " << name << ", e.what() = " << e.what();
stream << "std::exception. Code: " << ErrorCodes::STD_EXCEPTION
<< ", type: " << name << ", e.what() = " << e.what();
}
catch (...)
{
Expand All @@ -136,7 +144,8 @@ std::string getCurrentExceptionMessage(bool with_stacktrace, bool check_embedded
if (status)
name += " (demangling status: " + toString(status) + ")";

stream << "Unknown exception. Code: " << ErrorCodes::UNKNOWN_EXCEPTION << ", type: " << name;
stream << "Unknown exception. Code: " << ErrorCodes::UNKNOWN_EXCEPTION
<< ", type: " << name;
}
catch (...)
{
Expand All @@ -146,7 +155,6 @@ std::string getCurrentExceptionMessage(bool with_stacktrace, bool check_embedded
return stream.str();
}


int getCurrentExceptionCode()
{
try
Expand All @@ -171,15 +179,13 @@ int getCurrentExceptionCode()
}
}


void rethrowFirstException(const Exceptions & exceptions)
{
for (const auto & exception : exceptions)
if (exception)
std::rethrow_exception(exception);
}


std::string getExceptionMessage(const Exception & e, bool with_stacktrace, bool check_embedded_stacktrace)
{
std::stringstream stream;
Expand All @@ -200,7 +206,8 @@ std::string getExceptionMessage(const Exception & e, bool with_stacktrace, bool
}
}

stream << "Code: " << e.code() << ", e.displayText() = " << text << ", e.what() = " << e.what();
stream << "Code: " << e.code() << ", e.displayText() = " << text
<< ", e.what() = " << e.what();

if (with_stacktrace && !has_embedded_stack_trace)
stream << ", Stack trace:\n\n"
Expand All @@ -225,7 +232,6 @@ std::string getExceptionMessage(std::exception_ptr e, bool with_stacktrace)
}
}


std::string ExecutionStatus::serializeText() const
{
WriteBufferFromOwnString wb;
Expand Down Expand Up @@ -254,11 +260,20 @@ bool ExecutionStatus::tryDeserializeText(const std::string & data)
return true;
}

ExecutionStatus ExecutionStatus::fromCurrentException(const std::string & start_of_message)
ExecutionStatus
ExecutionStatus::fromCurrentException(const std::string & start_of_message)
{
String msg = (start_of_message.empty() ? "" : (start_of_message + ": ")) + getCurrentExceptionMessage(false, true);
return ExecutionStatus(getCurrentExceptionCode(), msg);
}

namespace exception_details
{
const LoggerPtr & getDefaultFatalLogger()
{
static const auto logger = std::make_shared<Logger>("DefaultFatal", "");
return logger;
}
} // namespace exception_details

} // namespace DB
Loading