Skip to content

Add BridgeGRpcClient #19546

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

Merged
merged 6 commits into from
Jun 20, 2025
Merged

Add BridgeGRpcClient #19546

merged 6 commits into from
Jun 20, 2025

Conversation

mregrock
Copy link
Collaborator

Changelog entry

Add BridgeGRpcClient

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

...

@mregrock mregrock requested a review from a team as a code owner June 10, 2025 09:51
@mregrock mregrock marked this pull request as draft June 10, 2025 09:51
Copy link

github-actions bot commented Jun 10, 2025

2025-06-10 09:52:16 UTC Pre-commit check linux-x86_64-relwithdebinfo for 3f2f96d has started.
2025-06-10 09:52:21 UTC Artifacts will be uploaded here
🔴 2025-06-10 09:54:21 UTC Graph compare failed, see the logs.

Copy link

🟢 2025-06-10 09:53:57 UTC The validation of the Pull Request description is successful.

Copy link

github-actions bot commented Jun 10, 2025

2025-06-10 09:55:26 UTC Pre-commit check linux-x86_64-release-asan for 3f2f96d has started.
2025-06-10 09:55:37 UTC Artifacts will be uploaded here
🔴 2025-06-10 09:57:32 UTC Graph compare failed, see the logs.

@mregrock mregrock requested a review from Copilot June 17, 2025 09:45
Copy link

github-actions bot commented Jun 17, 2025

2025-06-17 09:47:41 UTC Pre-commit check linux-x86_64-relwithdebinfo for aca5d54 has started.
2025-06-17 09:47:54 UTC Artifacts will be uploaded here
2025-06-17 09:51:55 UTC ya make is running...
🟡 2025-06-17 11:58:14 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39116 36400 0 16 2669 31

2025-06-17 12:01:37 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-06-17 12:17:50 UTC ydbd size 2.2 GiB changed* by +1.3 MiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 98c35b2 merge: aca5d54 diff diff %
ydbd size 2 371 015 048 Bytes 2 372 394 968 Bytes +1.3 MiB +0.058%
ydbd stripped size 497 343 688 Bytes 497 582 824 Bytes +233.5 KiB +0.048%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation
2025-06-17 12:17:52 UTC Check cancelled

Copy link

github-actions bot commented Jun 17, 2025

2025-06-17 09:47:59 UTC Pre-commit check linux-x86_64-release-asan for aca5d54 has started.
2025-06-17 09:48:12 UTC Artifacts will be uploaded here
2025-06-17 09:52:12 UTC ya make is running...
🔴 2025-06-17 12:18:29 UTC ydbd size 3.9 GiB changed* by +5.5 MiB, which is >= 2.0 MiB vs main: Alert

ydbd size dash main: 0ca2955 merge: aca5d54 diff diff %
ydbd size 4 167 354 616 Bytes 4 173 086 560 Bytes +5.5 MiB +0.138%
ydbd stripped size 1 446 053 048 Bytes 1 447 546 200 Bytes +1.4 MiB +0.103%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation
2025-06-17 12:18:31 UTC Check cancelled

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Introduces a new “bridge” service and client to manage per-pile cluster state via gRPC.

  • Registers a bridge module in build scripts and YaMake files.
  • Implements TBridgeGRpcService and backend handlers (rpc_bridge.cpp) for Get/UpdateClusterState.
  • Adds TBridgeClient in the C++ SDK along with protos (ydb_bridge.proto/ydb_bridge_v1.proto) and integrates the service into the runner and tracing.

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ydb/services/ya.make Added bridge to services build recursion
ydb/services/bridge/ya.make New build file for the bridge service
ydb/services/bridge/grpc_service.h Declares TBridgeGRpcService
ydb/services/bridge/grpc_service.cpp Implements service setup and incoming requests
ydb/public/sdk/cpp/src/client/bridge/ya.make Build file for the C++ bridge client
ydb/public/sdk/cpp/src/client/bridge/bridge.cpp Implements TBridgeClient methods
ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/bridge/bridge.h Public header for TBridgeClient API
ydb/public/api/protos/ya.make Includes ydb_bridge.proto
ydb/public/api/protos/draft/ydb_bridge.proto Defines bridge‐related protobuf messages
ydb/public/api/grpc/draft/ydb_bridge_v1.proto Defines BridgeService RPC methods
ydb/public/api/grpc/draft/ya.make Includes ydb_bridge_v1.proto
ydb/library/services/services.proto Adds BRIDGE enum to Kikimr services
ydb/core/jaeger_tracing/request_discriminator.h Registers BRIDGE_GETCLUSTERSTATE / UPDATE types
ydb/core/jaeger_tracing/request_discriminator.cpp Maps bridge RPC names to discriminator types
ydb/core/grpc_services/ya.make Adds rpc_bridge.cpp to core gRPC services
ydb/core/grpc_services/service_bridge.h Declares internal handlers DoGet/UpdateClusterState
ydb/core/grpc_services/rpc_bridge_base.h Base template for bridge request actors
ydb/core/grpc_services/rpc_bridge.cpp Implements bridge operation actor logic
ydb/core/driver_lib/run/ya.make Pulls in the bridge service for the driver
ydb/core/driver_lib/run/run.cpp Registers TBridgeGRpcService in the runner
Comments suppressed due to low confidence (3)

ydb/services/bridge/grpc_service.h:27

  • The member name GRpcRequestProxyId mixes uppercase G and lowercase r. Rename to GrpcRequestProxyId to match the common Grpc casing elsewhere.
    NActors::TActorId GRpcRequestProxyId;

ydb/public/sdk/cpp/include/ydb-cpp-sdk/client/bridge/bridge.h:1

  • The public API header lacks Doxygen or doc comments. Consider adding brief descriptions for TBridgeClient and its methods to match the style of other SDK clients.
#pragma once

ydb/public/sdk/cpp/src/client/bridge/bridge.cpp:8

  • No unit or integration tests accompany the new client code. Add tests for UpdateClusterState and GetClusterState to verify serialization, error handling, and response extraction.
namespace NYdb::inline Dev::NBridge {

Comment on lines 11 to 14
TBridgeGRpcService::TBridgeGRpcService(NActors::TActorSystem* actorSystem, TIntrusivePtr<NMonitoring::TDynamicCounters> counters, NActors::TActorId grpcRequestProxyId) \
: ActorSystem(actorSystem) \
, Counters(std::move(counters))
, GRpcRequestProxyId(grpcRequestProxyId)
Copy link
Preview

Copilot AI Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Avoid using backslashes for line continuation in C++ source files; reformat the constructor initializer list onto multiple lines without \ for better readability.

Suggested change
TBridgeGRpcService::TBridgeGRpcService(NActors::TActorSystem* actorSystem, TIntrusivePtr<NMonitoring::TDynamicCounters> counters, NActors::TActorId grpcRequestProxyId) \
: ActorSystem(actorSystem) \
, Counters(std::move(counters))
, GRpcRequestProxyId(grpcRequestProxyId)
TBridgeGRpcService::TBridgeGRpcService(
NActors::TActorSystem* actorSystem,
TIntrusivePtr<NMonitoring::TDynamicCounters> counters,
NActors::TActorId grpcRequestProxyId)
: ActorSystem(actorSystem),
Counters(std::move(counters)),
GRpcRequestProxyId(grpcRequestProxyId)

Copilot uses AI. Check for mistakes.

Copy link

github-actions bot commented Jun 17, 2025

2025-06-17 12:19:49 UTC Pre-commit check linux-x86_64-release-asan for ff4f328 has started.
2025-06-17 12:20:11 UTC Artifacts will be uploaded here
2025-06-17 12:24:38 UTC ya make is running...
2025-06-17 13:34:02 UTC Check cancelled

Copy link

github-actions bot commented Jun 17, 2025

2025-06-17 12:22:00 UTC Pre-commit check linux-x86_64-relwithdebinfo for ff4f328 has started.
2025-06-17 12:22:12 UTC Artifacts will be uploaded here
2025-06-17 12:26:06 UTC ya make is running...
2025-06-17 13:34:00 UTC Check cancelled

Copy link

github-actions bot commented Jun 17, 2025

2025-06-17 13:37:56 UTC Pre-commit check linux-x86_64-relwithdebinfo for b54798f has started.
2025-06-17 13:38:32 UTC Artifacts will be uploaded here
2025-06-17 13:42:39 UTC ya make is running...
2025-06-17 14:30:34 UTC Check cancelled

Copy link

github-actions bot commented Jun 17, 2025

2025-06-17 13:40:11 UTC Pre-commit check linux-x86_64-release-asan for b54798f has started.
2025-06-17 13:40:25 UTC Artifacts will be uploaded here
2025-06-17 13:44:15 UTC ya make is running...
2025-06-17 14:30:22 UTC Check cancelled

Copy link

github-actions bot commented Jun 17, 2025

2025-06-17 14:32:07 UTC Pre-commit check linux-x86_64-release-asan for 4bc32b8 has started.
2025-06-17 14:32:18 UTC Artifacts will be uploaded here
2025-06-17 14:34:11 UTC Check cancelled

@mregrock mregrock marked this pull request as ready for review June 17, 2025 14:34
Copy link

github-actions bot commented Jun 17, 2025

2025-06-17 14:36:41 UTC Pre-commit check linux-x86_64-release-asan for 9753b1f has started.
2025-06-17 14:36:50 UTC Artifacts will be uploaded here
2025-06-17 14:40:50 UTC ya make is running...
🟡 2025-06-17 17:05:01 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16748 16461 0 109 152 26

2025-06-17 17:06:25 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-06-17 17:44:35 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1925 (only retried tests) 1738 0 68 100 19

2025-06-17 17:44:55 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-06-17 18:20:25 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1522 (only retried tests) 1339 0 57 103 23

🟢 2025-06-17 18:20:41 UTC Build successful.
🔴 2025-06-17 18:21:17 UTC ydbd size 3.9 GiB changed* by +2.3 MiB, which is >= 2.0 MiB vs main: Alert

ydbd size dash main: 617d03a merge: 9753b1f diff diff %
ydbd size 4 172 736 512 Bytes 4 175 167 736 Bytes +2.3 MiB +0.058%
ydbd stripped size 1 446 994 936 Bytes 1 447 835 896 Bytes +821.2 KiB +0.058%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Jun 17, 2025

2025-06-17 14:38:51 UTC Pre-commit check linux-x86_64-relwithdebinfo for 9753b1f has started.
2025-06-17 14:39:03 UTC Artifacts will be uploaded here
2025-06-17 14:43:00 UTC ya make is running...
🟡 2025-06-17 16:47:54 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39126 36404 0 9 2663 50

2025-06-17 16:51:11 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-06-17 17:02:13 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
627 (only retried tests) 601 0 1 2 23

2025-06-17 17:02:26 UTC ya make is running... (failed tests rerun, try 3)
🔴 2025-06-17 17:14:11 UTC Some tests failed, follow the links below.

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
322 (only retried tests) 286 0 1 0 35

🟢 2025-06-17 17:14:18 UTC Build successful.
🟡 2025-06-17 17:14:44 UTC ydbd size 2.2 GiB changed* by +1.3 MiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 617d03a merge: 9753b1f diff diff %
ydbd size 2 372 411 864 Bytes 2 373 799 848 Bytes +1.3 MiB +0.059%
ydbd stripped size 497 432 328 Bytes 497 679 848 Bytes +241.7 KiB +0.050%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Jun 18, 2025

2025-06-18 09:15:43 UTC Pre-commit check linux-x86_64-relwithdebinfo for 2c32234 has started.
2025-06-18 09:15:52 UTC Artifacts will be uploaded here
2025-06-18 09:19:49 UTC ya make is running...
🟡 2025-06-18 11:18:18 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39136 36436 0 6 2664 30

2025-06-18 11:21:40 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-06-18 11:32:58 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
666 (only retried tests) 641 0 0 1 24

🟢 2025-06-18 11:33:08 UTC Build successful.
🟡 2025-06-18 11:33:27 UTC ydbd size 2.2 GiB changed* by +1.3 MiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: abeada2 merge: 2c32234 diff diff %
ydbd size 2 373 000 616 Bytes 2 374 388 528 Bytes +1.3 MiB +0.058%
ydbd stripped size 497 531 720 Bytes 497 779 176 Bytes +241.7 KiB +0.050%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Jun 18, 2025

2025-06-18 09:18:42 UTC Pre-commit check linux-x86_64-release-asan for 2c32234 has started.
2025-06-18 09:19:34 UTC Artifacts will be uploaded here
2025-06-18 09:24:07 UTC ya make is running...
🟡 2025-06-18 11:48:42 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16757 16480 0 99 152 26

2025-06-18 11:50:19 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-06-18 12:28:16 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1881 (only retried tests) 1685 0 110 61 25

2025-06-18 12:28:35 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-06-18 13:03:45 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1696 (only retried tests) 1549 0 57 67 23

🟢 2025-06-18 13:04:02 UTC Build successful.
🔴 2025-06-18 13:04:39 UTC ydbd size 3.9 GiB changed* by +2.3 MiB, which is >= 2.0 MiB vs main: Alert

ydbd size dash main: f08e9a4 merge: 2c32234 diff diff %
ydbd size 4 173 702 456 Bytes 4 176 137 784 Bytes +2.3 MiB +0.058%
ydbd stripped size 1 447 299 032 Bytes 1 448 144 088 Bytes +825.2 KiB +0.058%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link
Collaborator

@alexvru alexvru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good except some minor issues.

public:
using TBase::TBase;

void Bootstrap(const TActorContext& ctx) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need TActorContext anymore. Not in new code.

return false;
}

std::optional<ui32> primary, promoted;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ui32 -> TBridgePileId

Copy link

github-actions bot commented Jun 20, 2025

2025-06-20 07:59:11 UTC Pre-commit check linux-x86_64-relwithdebinfo for 2ad8de0 has started.
2025-06-20 07:59:23 UTC Artifacts will be uploaded here
2025-06-20 08:03:14 UTC ya make is running...
2025-06-20 08:23:18 UTC Check cancelled

Copy link

github-actions bot commented Jun 20, 2025

2025-06-20 08:00:54 UTC Pre-commit check linux-x86_64-release-asan for 2ad8de0 has started.
2025-06-20 08:01:05 UTC Artifacts will be uploaded here
2025-06-20 08:05:02 UTC ya make is running...
2025-06-20 08:23:18 UTC Check cancelled

Copy link

github-actions bot commented Jun 20, 2025

2025-06-20 08:24:34 UTC Pre-commit check linux-x86_64-relwithdebinfo for c07adb5 has started.
2025-06-20 08:24:51 UTC Artifacts will be uploaded here
2025-06-20 08:28:36 UTC ya make is running...
2025-06-20 08:31:11 UTC Check cancelled

Copy link

github-actions bot commented Jun 20, 2025

2025-06-20 08:24:35 UTC Pre-commit check linux-x86_64-release-asan for c07adb5 has started.
2025-06-20 08:24:57 UTC Artifacts will be uploaded here
2025-06-20 08:29:01 UTC ya make is running...
2025-06-20 08:31:09 UTC Check cancelled

Copy link

github-actions bot commented Jun 20, 2025

2025-06-20 08:32:28 UTC Pre-commit check linux-x86_64-relwithdebinfo for 2b33375 has started.
2025-06-20 08:32:37 UTC Artifacts will be uploaded here
2025-06-20 08:36:29 UTC ya make is running...
🟡 2025-06-20 10:15:22 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39252 36515 0 5 2668 64

2025-06-20 10:18:57 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-06-20 10:34:21 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
864 (only retried tests) 814 0 1 5 44

2025-06-20 10:34:34 UTC ya make is running... (failed tests rerun, try 3)
🟢 2025-06-20 10:49:58 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
553 (only retried tests) 504 0 0 5 44

🟢 2025-06-20 10:50:07 UTC Build successful.
🟡 2025-06-20 10:50:31 UTC ydbd size 2.2 GiB changed* by +1.3 MiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: f2672d3 merge: 2b33375 diff diff %
ydbd size 2 376 339 424 Bytes 2 377 733 560 Bytes +1.3 MiB +0.059%
ydbd stripped size 497 981 256 Bytes 498 226 152 Bytes +239.2 KiB +0.049%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Jun 20, 2025

2025-06-20 08:32:30 UTC Pre-commit check linux-x86_64-release-asan for 2b33375 has started.
2025-06-20 08:32:37 UTC Artifacts will be uploaded here
2025-06-20 08:36:33 UTC ya make is running...
🟡 2025-06-20 10:56:26 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16839 16484 0 127 200 28

2025-06-20 10:58:02 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-06-20 11:36:56 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1978 (only retried tests) 1716 0 57 180 25

2025-06-20 11:37:16 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-06-20 12:12:53 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1631 (only retried tests) 1366 0 68 172 25

🟢 2025-06-20 12:13:12 UTC Build successful.
🔴 2025-06-20 12:13:46 UTC ydbd size 3.9 GiB changed* by +2.3 MiB, which is >= 2.0 MiB vs main: Alert

ydbd size dash main: f2672d3 merge: 2b33375 diff diff %
ydbd size 4 180 099 296 Bytes 4 182 554 480 Bytes +2.3 MiB +0.059%
ydbd stripped size 1 449 133 240 Bytes 1 449 986 904 Bytes +833.7 KiB +0.059%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link
Collaborator

@Gazizonoki Gazizonoki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SDK - ok

@mregrock mregrock merged commit 032168b into ydb-platform:main Jun 20, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants