[Enhancement] update staros 3.4-rc3 (#54974)

Signed-off-by: starrocks-xupeng <xupeng@starrocks.com>
This commit is contained in:
starrocks-xupeng 2025-01-14 10:04:11 +08:00 committed by GitHub
parent e446727ee4
commit ece066f554
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 35 additions and 5 deletions

View File

@ -22,7 +22,7 @@ ARG predownload_thirdparty=false
ARG thirdparty_url=https://cdn-thirdparty.starrocks.com/starrocks-thirdparty-main-20240411.tar
ARG commit_id
# check thirdparty/starlet-artifacts-version.sh, to get the right tag
ARG starlet_tag=v3.4-rc2
ARG starlet_tag=v3.4-rc3
# build for which linux distro: centos7|ubuntu
ARG distro=ubuntu
# Token to access artifacts in private github repositories.

View File

@ -44,7 +44,7 @@ under the License.
<iceberg.version>1.6.0</iceberg.version>
<paimon.version>0.8.2</paimon.version>
<delta-kernel.version>4.0.0rc1</delta-kernel.version>
<staros.version>3.4-rc2</staros.version>
<staros.version>3.4-rc3</staros.version>
<python>python</python>
</properties>

View File

@ -778,10 +778,21 @@ public class StarOSAgent {
return result.getGroupId();
}
public void updateWorkerGroup(long workerGroupId, int replicaNumber) throws DdlException {
public void updateWorkerGroup(long workerGroupId, int replicaNumber, String replicationTypeStr)
throws DdlException {
prepare();
try {
client.updateWorkerGroup(serviceId, workerGroupId, null, null, replicaNumber);
ReplicationType replicationType = ReplicationType.NO_REPLICATION;
if (replicationTypeStr == null || replicationTypeStr.equalsIgnoreCase("NONE")) {
replicationType = ReplicationType.NO_REPLICATION;
} else if (replicationTypeStr.equalsIgnoreCase("SYNC")) {
replicationType = ReplicationType.SYNC;
} else if (replicationTypeStr.equalsIgnoreCase("ASYNC")) {
replicationType = ReplicationType.ASYNC;
} else {
throw new DdlException("Unknown replication type " + replicationTypeStr);
}
client.updateWorkerGroup(serviceId, workerGroupId, null, null, replicaNumber, replicationType);
} catch (StarClientException e) {
LOG.warn("Failed to update worker group. error: {}", e.getMessage());
throw new DdlException("Failed to update worker group. error: " + e.getMessage());

View File

@ -749,6 +749,25 @@ public class StarOSAgentTest {
() -> starosAgent.createWorkerGroup("size", 1, "aaa"));
}
@Test
public void testUpdateWorkerGroup() throws StarClientException, DdlException, StarRocksException {
new MockUp<StarClient>() {
@Mock
public WorkerGroupDetailInfo updateWorkerGroup(String serviceId, long groupId,
Map<String, String> labels, Map<String, String> properties, int replicaNumber,
ReplicationType replicationType) throws StarClientException {
return WorkerGroupDetailInfo.newBuilder().build();
}
};
Deencapsulation.setField(starosAgent, "serviceId", "1");
starosAgent.updateWorkerGroup(123, 1, null);
starosAgent.updateWorkerGroup(123, 1, "sync");
starosAgent.updateWorkerGroup(123, 1, "async");
ExceptionChecker.expectThrowsWithMsg(DdlException.class,
"Unknown replication type aaa",
() -> starosAgent.updateWorkerGroup(123, 1, "aaa"));
}
private Set<Long> getBackendIdsByShard(long shardId, long workerGroupId) throws StarRocksException {
return starosAgent.getAllNodeIdsByShard(shardId, workerGroupId, false);
}

View File

@ -9,4 +9,4 @@
# https://hub.docker.com/r/starrocks/starlet-artifacts-centos7/tags
#
# Update the following tag when STARLET releases a new version.
export STARLET_ARTIFACTS_TAG=v3.4-rc2
export STARLET_ARTIFACTS_TAG=v3.4-rc3