diff options
author | danilalexeev <danilalexeev@yandex-team.com> | 2024-04-09 13:18:33 +0300 |
---|---|---|
committer | danilalexeev <danilalexeev@yandex-team.com> | 2024-04-09 13:29:45 +0300 |
commit | 0f56c014df758b3128c3bb3738857d51c20a74e5 (patch) | |
tree | 67666a6f140708d9e68317c203ee7505358c7b2d | |
parent | b3230eabfae85a24140c46cb723bae72b9b32355 (diff) | |
download | ydb-0f56c014df758b3128c3bb3738857d51c20a74e5.tar.gz |
YT-21200: Add segment_id to get_master_consistent_state command
dd3d1a533e9900b2f6a4779a6f06a6255746c3d7
-rw-r--r-- | yt/yt/client/api/admin_client.h | 10 | ||||
-rw-r--r-- | yt/yt/client/api/delegating_client.h | 2 | ||||
-rw-r--r-- | yt/yt/client/api/rpc_proxy/client_impl.cpp | 2 | ||||
-rw-r--r-- | yt/yt/client/api/rpc_proxy/client_impl.h | 2 | ||||
-rw-r--r-- | yt/yt/client/driver/admin_commands.cpp | 7 | ||||
-rw-r--r-- | yt/yt/client/federated/client.cpp | 2 | ||||
-rw-r--r-- | yt/yt/client/hedging/hedging.cpp | 2 | ||||
-rw-r--r-- | yt/yt/client/unittests/mock/client.h | 2 |
8 files changed, 18 insertions, 11 deletions
diff --git a/yt/yt/client/api/admin_client.h b/yt/yt/client/api/admin_client.h index 1780ad0ab7..8a374df98c 100644 --- a/yt/yt/client/api/admin_client.h +++ b/yt/yt/client/api/admin_client.h @@ -158,8 +158,14 @@ struct TResurrectChunkLocationsResult std::vector<TGuid> LocationUuids; }; +struct TMasterConsistentState +{ + i64 SequenceNumber; + i64 SegmentId; +}; + using TCellIdToSnapshotIdMap = THashMap<NHydra::TCellId, int>; -using TCellIdToSequenceNumberMap = THashMap<NHydra::TCellId, i64>; +using TCellIdToConsistentStateMap = THashMap<NHydra::TCellId, TMasterConsistentState>; struct TAddMaintenanceOptions : public TTimeoutOptions @@ -205,7 +211,7 @@ struct IAdminClient virtual TFuture<TCellIdToSnapshotIdMap> BuildMasterSnapshots( const TBuildMasterSnapshotsOptions& options = {}) = 0; - virtual TFuture<TCellIdToSequenceNumberMap> GetMasterConsistentState( + virtual TFuture<TCellIdToConsistentStateMap> GetMasterConsistentState( const TGetMasterConsistentStateOptions& options = {}) = 0; virtual TFuture<void> ExitReadOnly( diff --git a/yt/yt/client/api/delegating_client.h b/yt/yt/client/api/delegating_client.h index e4d3341492..c5044d846b 100644 --- a/yt/yt/client/api/delegating_client.h +++ b/yt/yt/client/api/delegating_client.h @@ -558,7 +558,7 @@ public: const TBuildMasterSnapshotsOptions& options), (options)) - DELEGATE_METHOD(TFuture<TCellIdToSequenceNumberMap>, GetMasterConsistentState, ( + DELEGATE_METHOD(TFuture<TCellIdToConsistentStateMap>, GetMasterConsistentState, ( const TGetMasterConsistentStateOptions& options), (options)) diff --git a/yt/yt/client/api/rpc_proxy/client_impl.cpp b/yt/yt/client/api/rpc_proxy/client_impl.cpp index df1d4caada..37d17eacbf 100644 --- a/yt/yt/client/api/rpc_proxy/client_impl.cpp +++ b/yt/yt/client/api/rpc_proxy/client_impl.cpp @@ -1647,7 +1647,7 @@ TFuture<TCellIdToSnapshotIdMap> TClient::BuildMasterSnapshots(const TBuildMaster ThrowUnimplemented("BuildMasterSnapshots"); } -TFuture<TCellIdToSequenceNumberMap> TClient::GetMasterConsistentState(const TGetMasterConsistentStateOptions& /*options*/) +TFuture<TCellIdToConsistentStateMap> TClient::GetMasterConsistentState(const TGetMasterConsistentStateOptions& /*options*/) { ThrowUnimplemented("GetMasterConsistentState"); } diff --git a/yt/yt/client/api/rpc_proxy/client_impl.h b/yt/yt/client/api/rpc_proxy/client_impl.h index 3c66f30c87..77054ed4e5 100644 --- a/yt/yt/client/api/rpc_proxy/client_impl.h +++ b/yt/yt/client/api/rpc_proxy/client_impl.h @@ -323,7 +323,7 @@ public: TFuture<TCellIdToSnapshotIdMap> BuildMasterSnapshots( const TBuildMasterSnapshotsOptions& options) override; - TFuture<TCellIdToSequenceNumberMap> GetMasterConsistentState( + TFuture<TCellIdToConsistentStateMap> GetMasterConsistentState( const TGetMasterConsistentStateOptions& options) override; TFuture<void> ExitReadOnly( diff --git a/yt/yt/client/driver/admin_commands.cpp b/yt/yt/client/driver/admin_commands.cpp index 4586547f11..794e0cb204 100644 --- a/yt/yt/client/driver/admin_commands.cpp +++ b/yt/yt/client/driver/admin_commands.cpp @@ -106,15 +106,16 @@ void TGetMasterConsistentStateCommand::Register(TRegistrar /*registrar*/) void TGetMasterConsistentStateCommand::DoExecute(ICommandContextPtr context) { - auto cellIdToSequenceNumber = WaitFor(context->GetClient()->GetMasterConsistentState(Options)) + auto cellIdToConsistentState = WaitFor(context->GetClient()->GetMasterConsistentState(Options)) .ValueOrThrow(); context->ProduceOutputValue(BuildYsonStringFluently() - .DoListFor(cellIdToSequenceNumber, [=] (TFluentList fluent, const auto& pair) { + .DoListFor(cellIdToConsistentState, [=] (TFluentList fluent, const auto& pair) { fluent .Item().BeginMap() .Item("cell_id").Value(pair.first) - .Item("sequence_number").Value(pair.second) + .Item("sequence_number").Value(pair.second.SequenceNumber) + .Item("segment_id").Value(pair.second.SegmentId) .EndMap(); })); } diff --git a/yt/yt/client/federated/client.cpp b/yt/yt/client/federated/client.cpp index 1e43f174a0..fa7407095a 100644 --- a/yt/yt/client/federated/client.cpp +++ b/yt/yt/client/federated/client.cpp @@ -386,7 +386,7 @@ public: UNIMPLEMENTED_METHOD(TFuture<void>, CheckClusterLiveness, (const TCheckClusterLivenessOptions&)); UNIMPLEMENTED_METHOD(TFuture<int>, BuildSnapshot, (const TBuildSnapshotOptions&)); UNIMPLEMENTED_METHOD(TFuture<TCellIdToSnapshotIdMap>, BuildMasterSnapshots, (const TBuildMasterSnapshotsOptions&)); - UNIMPLEMENTED_METHOD(TFuture<TCellIdToSequenceNumberMap>, GetMasterConsistentState, (const TGetMasterConsistentStateOptions&)); + UNIMPLEMENTED_METHOD(TFuture<TCellIdToConsistentStateMap>, GetMasterConsistentState, (const TGetMasterConsistentStateOptions&)); UNIMPLEMENTED_METHOD(TFuture<void>, ExitReadOnly, (NObjectClient::TCellId, const TExitReadOnlyOptions&)); UNIMPLEMENTED_METHOD(TFuture<void>, MasterExitReadOnly, (const TMasterExitReadOnlyOptions&)); UNIMPLEMENTED_METHOD(TFuture<void>, DiscombobulateNonvotingPeers, (NObjectClient::TCellId, const TDiscombobulateNonvotingPeersOptions&)); diff --git a/yt/yt/client/hedging/hedging.cpp b/yt/yt/client/hedging/hedging.cpp index 6d0122b584..0ceb3aab9c 100644 --- a/yt/yt/client/hedging/hedging.cpp +++ b/yt/yt/client/hedging/hedging.cpp @@ -173,7 +173,7 @@ public: UNSUPPORTED_METHOD(TFuture<void>, CheckClusterLiveness, (const TCheckClusterLivenessOptions&)); UNSUPPORTED_METHOD(TFuture<int>, BuildSnapshot, (const TBuildSnapshotOptions&)); UNSUPPORTED_METHOD(TFuture<TCellIdToSnapshotIdMap>, BuildMasterSnapshots, (const TBuildMasterSnapshotsOptions&)); - UNSUPPORTED_METHOD(TFuture<TCellIdToSequenceNumberMap>, GetMasterConsistentState, (const TGetMasterConsistentStateOptions&)); + UNSUPPORTED_METHOD(TFuture<TCellIdToConsistentStateMap>, GetMasterConsistentState, (const TGetMasterConsistentStateOptions&)); UNSUPPORTED_METHOD(TFuture<void>, ExitReadOnly, (NObjectClient::TCellId, const TExitReadOnlyOptions&)); UNSUPPORTED_METHOD(TFuture<void>, MasterExitReadOnly, (const TMasterExitReadOnlyOptions&)); UNSUPPORTED_METHOD(TFuture<void>, DiscombobulateNonvotingPeers, (NObjectClient::TCellId, const TDiscombobulateNonvotingPeersOptions&)); diff --git a/yt/yt/client/unittests/mock/client.h b/yt/yt/client/unittests/mock/client.h index 0ab1250f20..ea199b554e 100644 --- a/yt/yt/client/unittests/mock/client.h +++ b/yt/yt/client/unittests/mock/client.h @@ -238,7 +238,7 @@ public: const TBuildMasterSnapshotsOptions& options), (override)); - MOCK_METHOD(TFuture<TCellIdToSequenceNumberMap>, GetMasterConsistentState, ( + MOCK_METHOD(TFuture<TCellIdToConsistentStateMap>, GetMasterConsistentState, ( const TGetMasterConsistentStateOptions& options), (override)); |