-
Notifications
You must be signed in to change notification settings - Fork 422
*: backport FTS/TiCI to release-8.5 #11074
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
base: release-8.5
Are you sure you want to change the base?
Changes from all commits
fcdfb92
c84e208
3a403b3
6d4180e
40fbc3b
cad3d06
715261d
fdbb0f8
e539cb5
3c16301
181e349
3526279
2b4b935
c9b1911
5b5e890
14e263c
8270bd1
38cba05
57b26d7
fdb2b81
ccf28c2
9770c01
0caa9f6
5aee201
7c3c64b
043181d
c6f2228
e51d764
503cea8
adbba63
72449be
64b9f74
46298d8
8d65aae
58bde36
54c60d1
799bbc6
a246027
ae1e36c
8964aae
2537e93
6ffeecf
488b30f
851f49f
3721a20
77df106
c87864f
f710e7f
2ccd3d8
7ebc264
3bc30c8
59083d2
bdf221c
6bb0990
08189f8
a5ac28a
6cbd060
d7746ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| +41 −0 | CMakeLists.txt | |
| +8 −80 | OWNERS | |
| +84 −0 | OWNERS_ALIASES | |
| +2 −2 | include/pingcap/common/MPPProber.h | |
| +25 −0 | include/pingcap/coprocessor/Client.h | |
| +5 −5 | include/pingcap/kv/Cluster.h | |
| +19 −73 | include/pingcap/kv/RegionCache.h | |
| +22 −15 | include/pingcap/kv/RegionClient.h | |
| +8 −36 | include/pingcap/kv/Rpc.h | |
| +223 −0 | include/pingcap/kv/ShardCache.h | |
| +101 −0 | include/pingcap/kv/ShardClient.h | |
| +7 −7 | include/pingcap/pd/Client.h | |
| +8 −9 | include/pingcap/pd/IClient.h | |
| +35 −10 | include/pingcap/pd/MockPDClient.h | |
| +133 −0 | proto/kvproto/schema.proto | |
| +330 −0 | proto/kvproto/tici.proto | |
| +3 −1 | src/CMakeLists.txt | |
| +3 −5 | src/common/MPPProber.cc | |
| +180 −38 | src/coprocessor/Client.cc | |
| +0 −3 | src/kv/Cluster.cc | |
| +57 −112 | src/kv/RegionCache.cc | |
| +4 −5 | src/kv/RegionClient.cc | |
| +1 −103 | src/kv/Rpc.cc | |
| +167 −0 | src/kv/ShardCache.cc | |
| +1 −1 | src/kv/Snapshot.cc | |
| +58 −13 | src/pd/Client.cc | |
| +2 −1 | src/test/CMakeLists.txt | |
| +0 −67 | src/test/region_cache_test.cc | |
| +291 −0 | src/test/shard_cache_test.cc | |
| +1 −1 | third_party/kvproto |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| set(TICI_PROJECT_DIR "${CMAKE_SOURCE_DIR}/contrib/tici") | ||
| set(TICI_LIB_NAME "tici_search_lib") | ||
| set(TICI_LIB "${CMAKE_CURRENT_BINARY_DIR}/release/${CMAKE_STATIC_LIBRARY_PREFIX}${TICI_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") | ||
|
|
||
| file(GLOB LIB_SOURCE_FILES "${TICI_PROJECT_DIR}/src/*") | ||
| file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cxxbridge) | ||
|
|
||
| add_custom_command( | ||
| OUTPUT ${TICI_LIB} | ||
| COMMAND cargo build -p tici-search-lib --release --target-dir ${CMAKE_CURRENT_BINARY_DIR} --manifest-path ${TICI_PROJECT_DIR}/Cargo.toml | ||
| WORKING_DIRECTORY ${TICI_PROJECT_DIR} | ||
| DEPENDS ${LIB_SOURCE_FILES} | ||
| COMMENT "Build Rust lib" | ||
| ) | ||
|
|
||
| add_custom_target(rustbuild ALL DEPENDS ${TICI_LIB}) | ||
| add_library(tici_search_lib_static STATIC IMPORTED GLOBAL) | ||
| set_target_properties(tici_search_lib_static PROPERTIES | ||
| IMPORTED_LOCATION ${TICI_LIB} | ||
| ) | ||
|
|
||
| add_dependencies(tici_search_lib_static rustbuild) | ||
| target_include_directories(tici_search_lib_static INTERFACE | ||
| ${CMAKE_CURRENT_BINARY_DIR}/cxxbridge) | ||
|
|
||
| add_library(tici_search_lib SHARED "${TiFlash_SOURCE_DIR}/libs/libclara-cmake/dummy.cpp") | ||
| target_compile_options(tici_search_lib PRIVATE -pthread) | ||
| target_link_options(tici_search_lib PRIVATE -pthread) | ||
| target_link_libraries(tici_search_lib PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,tici_search_lib_static>") | ||
| if(APPLE) | ||
| target_link_libraries(tici_search_lib PRIVATE | ||
| "-framework Security" | ||
| "-framework CoreFoundation" | ||
| "-framework IOKit" | ||
| ) | ||
| endif() | ||
|
|
||
| target_include_directories(tici_search_lib INTERFACE | ||
| ${CMAKE_CURRENT_BINARY_DIR}/cxxbridge) | ||
| +3 −2 | .github/workflows/unit-test.yml | |
| +7 −0 | generate-go.sh | |
| +6 −0 | go-tipb/analyze.pb.go | |
| +3,082 −685 | go-tipb/executor.pb.go | |
| +385 −366 | go-tipb/expression.pb.go | |
| +617 −79 | go-tipb/select.pb.go | |
| +3,389 −0 | go-tipb/tici.pb.go | |
| +124 −51 | go-tipb/topsql_agent.pb.go | |
| +86 −2 | proto/executor.proto | |
| +7 −0 | proto/expression.proto | |
| +40 −1 | proto/select.proto | |
| +167 −0 | proto/tici/indexer.proto | |
| +2 −0 | proto/topsql_agent.proto | |
| +8,121 −0 | scripts/proto.lock |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -270,7 +270,10 @@ BlockInputStreamPtr executeMPPQuery(Context & context, const DAGProperties & pro | |
| mpp::DispatchTaskResponse resp; | ||
| auto status = rpc.call(&client_context, req, &resp); | ||
| if (!status.ok()) | ||
| throw Exception("Meet grpc error while dispatch mpp task: " + rpc.errMsg(status)); | ||
| { | ||
| std::string extra_msg = "addr: " + Debug::LOCAL_HOST; | ||
| throw Exception("Meet grpc error while dispatch mpp task: " + rpc.errMsg(status, extra_msg)); | ||
|
Comment on lines
+274
to
+275
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Use the project-standard exception and string constructors. At Line 274, use As per coding guidelines, 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| } | ||
| if (resp.has_error()) | ||
| throw Exception("Meet error while dispatch mpp task: " + resp.error().msg()); | ||
| } | ||
|
|
@@ -399,8 +402,17 @@ tipb::SelectResponse executeDAGRequest( | |
| region_id, | ||
| RegionInfo(region_id, region_version, region_conf_version, std::move(key_ranges), nullptr)); | ||
|
|
||
| DAGContext | ||
| dag_context(dag_request, std::move(tables_regions_info), NullspaceID, "", DAGRequestKind::Cop, "", 0, "", log); | ||
| DAGContext dag_context( | ||
| dag_request, | ||
| std::move(tables_regions_info), | ||
| QueryShardInfos(), | ||
| NullspaceID, | ||
| "", | ||
| DAGRequestKind::Cop, | ||
| "", | ||
| 0, | ||
| "", | ||
| log); | ||
| context.setDAGContext(&dag_context); | ||
|
|
||
| DAGDriver<DAGRequestKind::Cop> driver(context, start_ts, DEFAULT_UNSPECIFIED_SCHEMA_VERSION, &dag_response, true); | ||
|
|
@@ -434,8 +446,17 @@ bool runAndCompareDagReq( | |
| region_id, | ||
| RegionInfo(region_id, region->version(), region->confVer(), std::move(key_ranges), nullptr)); | ||
|
|
||
| DAGContext | ||
| dag_context(dag_request, std::move(tables_regions_info), NullspaceID, "", DAGRequestKind::Cop, "", 0, "", log); | ||
| DAGContext dag_context( | ||
| dag_request, | ||
| std::move(tables_regions_info), | ||
| QueryShardInfos(), | ||
| NullspaceID, | ||
| "", | ||
| DAGRequestKind::Cop, | ||
| "", | ||
| 0, | ||
| "", | ||
| log); | ||
| context.setDAGContext(&dag_context); | ||
| DAGDriver<DAGRequestKind::Cop> | ||
| driver(context, properties.start_ts, DEFAULT_UNSPECIFIED_SCHEMA_VERSION, &dag_response, true); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,8 +52,9 @@ grpc::Status BatchCoprocessorHandler::execute() | |
|
|
||
| try | ||
| { | ||
| bool is_tici = cop_request->table_shard_infos_size() != 0; | ||
| RUNTIME_CHECK_MSG( | ||
| !cop_context.db_context.getSharedContextDisagg()->isDisaggregatedComputeMode(), | ||
| !cop_context.db_context.getSharedContextDisagg()->isDisaggregatedComputeMode() || is_tici, | ||
|
Comment on lines
+55
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift Validate an actual TiCI scan before the disaggregated-compute bypass.
As per coding guidelines, method and variable names must use camelCase. 📍 Affects 2 files
🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| "cannot run cop or batchCop request on tiflash_compute node"); | ||
|
|
||
| switch (cop_request->tp()) | ||
|
|
@@ -79,6 +80,7 @@ grpc::Status BatchCoprocessorHandler::execute() | |
| DAGContext dag_context( | ||
| dag_request, | ||
| std::move(tables_regions_info), | ||
| QueryShardInfos::create(cop_request->table_shard_infos()), | ||
| RequestUtils::deriveKeyspaceID(cop_request->context()), | ||
| cop_context.db_context.getClientInfo().current_address.toString(), | ||
| DAGRequestKind::BatchCop, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: pingcap/tiflash
Length of output: 22004
🏁 Script executed:
Repository: pingcap/tiflash
Length of output: 12540
Track all Rust build inputs.
LIB_SOURCE_FILEScontains only immediate children ofcontrib/tici/src. It does not trackCargo.toml,Cargo.lock, build scripts, orrust-toolchain.toml. Changes to these files can leave${TICI_LIB}up to date, so Cargo does not run and TiFlash links a stale artifact.Use recursive
CONFIGURE_DEPENDStracking for the Cargo workspace, or use an explicit build stamp.🤖 Prompt for AI Agents