-
Notifications
You must be signed in to change notification settings - Fork 423
*: backport FTS/TiCI to release-8.5-fts #11099
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
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
3c33869
824e93a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| +42 −0 | .github/workflows/pull-build-test.yml | |
| +1 −1 | .gitmodules | |
| +41 −0 | CMakeLists.txt | |
| +8 −80 | OWNERS | |
| +84 −0 | OWNERS_ALIASES | |
| +54 −26 | ci/Dockerfile | |
| +5 −1 | cmake/Modules/FindgRPC.cmake | |
| +2 −2 | include/pingcap/common/MPPProber.h | |
| +25 −0 | include/pingcap/coprocessor/Client.h | |
| +1 −0 | include/pingcap/kv/Cluster.h | |
| +15 −38 | include/pingcap/kv/RegionCache.h | |
| +19 −12 | include/pingcap/kv/RegionClient.h | |
| +8 −2 | include/pingcap/kv/Rpc.h | |
| +223 −0 | include/pingcap/kv/ShardCache.h | |
| +101 −0 | include/pingcap/kv/ShardClient.h | |
| +3 −5 | include/pingcap/pd/Client.h | |
| +2 −5 | include/pingcap/pd/IClient.h | |
| +8 −9 | 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 | |
| +162 −18 | src/coprocessor/Client.cc | |
| +54 −29 | src/kv/RegionCache.cc | |
| +3 −3 | src/kv/RegionClient.cc | |
| +167 −0 | src/kv/ShardCache.cc | |
| +1 −1 | src/kv/Snapshot.cc | |
| +9 −12 | src/pd/Client.cc | |
| +2 −0 | src/test/CMakeLists.txt | |
| +291 −0 | src/test/shard_cache_test.cc | |
| +1 −1 | third_party/kvproto |
| +8 −0 | .agents/skills/README.md | |
| +38 −0 | .agents/skills/backup-meta-schema-version/SKILL.md | |
| +2 −0 | .github/workflows/golang-test.yaml | |
| +3 −1 | .github/workflows/rust-test.yaml | |
| +24 −0 | AGENTS.md | |
| +7 −0 | README.md | |
| +12 −0 | pkg/brpb/backup_schema_version.go | |
| +426 −310 | pkg/brpb/brpb.pb.go | |
| +2,478 −698 | pkg/coprocessor/coprocessor.pb.go | |
| +287 −157 | pkg/import_sstpb/import_sstpb.pb.go | |
| +544 −473 | pkg/kvrpcpb/kvrpcpb.pb.go | |
| +127 −62 | pkg/mpp/mpp.pb.go | |
| +2,639 −762 | pkg/pdpb/pdpb.pb.go | |
| +131 −95 | pkg/schedulingpb/schedulingpb.pb.go | |
| +287 −173 | pkg/tikvpb/tikvpb.pb.go | |
| +8 −0 | proto/brpb.proto | |
| +46 −0 | proto/coprocessor.proto | |
| +11 −2 | proto/import_sstpb.proto | |
| +12 −0 | proto/kvrpcpb.proto | |
| +2 −0 | proto/mpp.proto | |
| +53 −2 | proto/pdpb.proto | |
| +1 −0 | proto/schedulingpb.proto | |
| +11 −0 | proto/tikvpb.proto | |
| +1 −0 | scripts/generate_go.sh | |
| +352 −1 | scripts/proto.lock | |
| +2 −0 | src/lib.rs |
| 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,445 −878 | 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 | |
| +90 −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)); | ||
|
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 🔎 Supported by static analysis🏁 Script executed: sed -n '120,135p' dbms/src/Flash/Coprocessor/ShardInfo.h
sed -n '268,280p' dbms/src/Debug/dbgQueryExecutor.cppRepository: pingcap/tiflash Length of output: 1241 🤖 get_repo_knowledge executed:
Length of output: 7385 🏁 Script executed: #!/bin/bash
sed -n '1,55p' dbms/src/Flash/Coprocessor/ShardInfo.h
sed -n '115,135p' dbms/src/Flash/Coprocessor/ShardInfo.h
sed -n '1,45p' dbms/src/Debug/dbgQueryExecutor.cpp
sed -n '255,280p' dbms/src/Debug/dbgQueryExecutor.cpp
rg -n --glob '*.{cpp,h,hpp}' 'Exception\\([^;]*ErrorCodes::|Exception\\([^;]*fmt::format|Exception\\([^;]*\\{\\}' dbms/src/Flash/Coprocessor/ShardInfo.h dbms/src/Debug/dbgQueryExecutor.cpp dbms/src/Debug dbms/src/Flash/Coprocessor | head -80
rg -n 'class Exception|Exception\\(' dbms/src/Exception.h dbms/src/Exception.cpp dbms/src/Core 2>/dev/null | head -80Repository: pingcap/tiflash Length of output: 5708 🏁 Script executed: #!/bin/bash
set -o pipefail
find dbms/src -name 'Exception.h' -o -name 'Exception.cpp' | sort
rg -n -F 'class Exception' dbms/src 2>/dev/null | head -20
rg -n -F 'Exception(ErrorCodes::' dbms/src/Flash/Coprocessor dbms/src/Debug | head -60
rg -n -F 'throw Exception(' dbms/src/Flash/Coprocessor/ShardInfo.h dbms/src/Flash/Coprocessor dbms/src/Debug | head -100Repository: pingcap/tiflash Length of output: 12278 Use a coded fmt-style This C++ path uses the one-argument constructor and concatenates the RPC message. Pass an appropriate registered 🤖 Prompt for AI Agents |
||
| } | ||
| 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); | ||
|
|
||
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
Track all Cargo build inputs.
DEPENDSexcludesCargo.tomlandCargo.lock. After either file changes, CMake can treat${TICI_LIB}as current and skipcargo build. The resulting TiFlash binary can link the previous Rust archive.Add the workspace manifests, lockfile, build scripts, and recursive Rust sources as dependencies.
Proposed fix
🤖 Prompt for AI Agents