Skip to content

Commit

Permalink
issue-1657: resize deivce in refresh endpoint (#2006) (#2046)
Browse files Browse the repository at this point in the history
issue: #1657

cherry-pick: 2bda054
  • Loading branch information
antonmyagkov authored Sep 17, 2024
1 parent d52f0b1 commit d4c0c26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 7 additions & 0 deletions cloud/blockstore/libs/endpoints/endpoint_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 2 additions & 4 deletions cloud/blockstore/tests/e2e-tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d4c0c26

Please sign in to comment.