From d4c0c26a3472062aa54df497d484e5bda7c083ee Mon Sep 17 00:00:00 2001 From: Anton Myagkov Date: Tue, 17 Sep 2024 14:42:55 +0200 Subject: [PATCH] issue-1657: resize deivce in refresh endpoint (#2006) (#2046) issue: #1657 cherry-pick: 2bda054 --- cloud/blockstore/libs/endpoints/endpoint_manager.cpp | 7 +++++++ cloud/blockstore/tests/e2e-tests/test.py | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cloud/blockstore/libs/endpoints/endpoint_manager.cpp b/cloud/blockstore/libs/endpoints/endpoint_manager.cpp index 681b1cccba..751bdbfb1d 100644 --- a/cloud/blockstore/libs/endpoints/endpoint_manager.cpp +++ b/cloud/blockstore/libs/endpoints/endpoint_manager.cpp @@ -1203,6 +1203,13 @@ NProto::TRefreshEndpointResponse TEndpointManager::RefreshEndpointImpl( return TErrorResponse(getSessionError); } + auto error = it->second.Device->Resize( + sessionInfo.Volume.GetBlocksCount() * + sessionInfo.Volume.GetBlockSize()).GetValueSync(); + if (HasError(error)) { + return TErrorResponse(error); + } + const auto refreshError = listener->RefreshEndpoint(socketPath, sessionInfo.Volume); return TErrorResponse(refreshError); } diff --git a/cloud/blockstore/tests/e2e-tests/test.py b/cloud/blockstore/tests/e2e-tests/test.py index 951ec59ebb..f7a814d935 100644 --- a/cloud/blockstore/tests/e2e-tests/test.py +++ b/cloud/blockstore/tests/e2e-tests/test.py @@ -180,11 +180,9 @@ def test_resize_device(with_netlink, with_endpoint_proxy): assert result.returncode == 0 result = run( - "resizedevice", + "refreshendpoint", "--socket", - socket_path, - "--device-size", - str(new_volume_size) + socket_path ) assert result.returncode == 0