[M] Change in asterixdb[master]: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits
>From Michael Blow :
Michael Blow has submitted this change. (
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email )
Change subject: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job
splits
..
[ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits
- user model changes: no
- storage format changes: no
- interface changes: no
Details: ExternalLibraryJobUtils built the create/drop library jobs over
every registered cluster partition, active or not. A failed node's
partitions stay registered, deactivated, until the node is removed or
rejoins, and in a cloud deployment, where compute partitions are fixed,
nothing takes them over. So after a failover the jobs were scheduled on
the failed node and rejected with HYR0010 (node does not exist), the
abort job the same way, and the library could not be created, replaced
or dropped until the node was dealt with, though the cluster was ACTIVE.
Ext-ref: MB-74378
Generated-by: Claude Opus 5.5
Change-Id: I45e60290961bdd325bf9734bb8806e2c9357afa9
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986
Tested-by: Michael Blow
Reviewed-by: Michael Blow
Reviewed-by: Ian Maxon
---
M
asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryJobUtils.java
A
asterixdb/asterix-app/src/test/java/org/apache/asterix/app/external/ExternalLibraryJobUtilsTest.java
2 files changed, 72 insertions(+), 1 deletion(-)
Approvals:
Ian Maxon: Looks good to me, approved
Michael Blow: Looks good to me, but someone else must approve; Verified
diff --git
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryJobUtils.java
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryJobUtils.java
index fd829c9..68cac36 100644
---
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryJobUtils.java
+++
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryJobUtils.java
@@ -126,12 +126,17 @@
return StoragePathUtil.splitProviderAndPartitionConstraints(splits);
}
-private static FileSplit[] getSplits(IClusterStateManager
clusterStateManager) {
+static FileSplit[] getSplits(IClusterStateManager clusterStateManager) {
ClusterPartition[] clusterPartitions =
clusterStateManager.getClusterPartitons();
Arrays.sort(clusterPartitions,
Comparator.comparing(ClusterPartition::getNodeId).thenComparingInt(ClusterPartition::getIODeviceNum));
List splits = new ArrayList<>();
for (ClusterPartition partition : clusterPartitions) {
+// a failed node's partitions stay registered, deactivated, until
it is removed or rejoins; when
+// compute partitions are fixed (cloud) nothing takes them over,
so a job sent there cannot start
+if (!partition.isActive()) {
+continue;
+}
String activeNodeId = partition.getActiveNodeId();
int n = splits.size();
if (n > 0 && splits.get(n - 1).getNodeName().equals(activeNodeId))
{
diff --git
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/app/external/ExternalLibraryJobUtilsTest.java
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/app/external/ExternalLibraryJobUtilsTest.java
new file mode 100644
index 000..6c7007f
--- /dev/null
+++
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/app/external/ExternalLibraryJobUtilsTest.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.asterix.app.external;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.asterix.common.cluster.ClusterPartition;
+import org.apache.asterix.common.cluster.IClusterStateManager;
+import org.apache.hyracks.api.io.FileSplit;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+public class ExternalLibraryJobUtilsTest {
+
+@Test
+public void oneSplitPerActiveNode() {
+IClusterStateManager csm = clusterOf(partition(0, "nc1", 0,
[M] Change in asterixdb[master]: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits
>From Ian Maxon : Attention is currently required from: Ali Alsuliman, Hussain Towaileb, Michael Blow, Murtadha Hubail. Ian Maxon has posted comments on this change by Michael Blow. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email ) Change subject: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits .. Patch Set 2: Code-Review+2 (1 comment) Patchset: PS2: d'oh -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: I45e60290961bdd325bf9734bb8806e2c9357afa9 Gerrit-Change-Number: 21986 Gerrit-PatchSet: 2 Gerrit-Owner: Michael Blow Gerrit-Reviewer: Ali Alsuliman Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Hussain Towaileb Gerrit-Reviewer: Ian Maxon Gerrit-Reviewer: Jenkins Gerrit-Reviewer: Michael Blow Gerrit-Reviewer: Murtadha Hubail Gerrit-Attention: Murtadha Hubail Gerrit-Attention: Ali Alsuliman Gerrit-Attention: Michael Blow Gerrit-Attention: Hussain Towaileb Gerrit-Comment-Date: Sat, 03 Oct 2026 19:51:03 + Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
[M] Change in asterixdb[master]: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits
>From Michael Blow : Attention is currently required from: Ali Alsuliman, Hussain Towaileb, Ian Maxon, Michael Blow, Murtadha Hubail. Michael Blow has removed a vote from this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email ) Change subject: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits .. Removed Integration-Tests-1 by Jenkins -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: deleteVote Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: I45e60290961bdd325bf9734bb8806e2c9357afa9 Gerrit-Change-Number: 21986 Gerrit-PatchSet: 2 Gerrit-Owner: Michael Blow Gerrit-Reviewer: Ali Alsuliman Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Hussain Towaileb Gerrit-Reviewer: Ian Maxon Gerrit-Reviewer: Jenkins Gerrit-Reviewer: Michael Blow Gerrit-Reviewer: Murtadha Hubail Gerrit-Attention: Murtadha Hubail Gerrit-Attention: Ian Maxon Gerrit-Attention: Ali Alsuliman Gerrit-Attention: Michael Blow Gerrit-Attention: Hussain Towaileb
[M] Change in asterixdb[master]: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits
>From Jenkins : Attention is currently required from: Ali Alsuliman, Hussain Towaileb, Ian Maxon, Michael Blow, Murtadha Hubail. Jenkins has posted comments on this change by Michael Blow. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email ) Change subject: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits .. Patch Set 2: Integration-Tests-1 Integration Tests Failed https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-trigger/8097/ : UNSTABLE -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: I45e60290961bdd325bf9734bb8806e2c9357afa9 Gerrit-Change-Number: 21986 Gerrit-PatchSet: 2 Gerrit-Owner: Michael Blow Gerrit-Reviewer: Ali Alsuliman Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Hussain Towaileb Gerrit-Reviewer: Ian Maxon Gerrit-Reviewer: Jenkins Gerrit-Reviewer: Michael Blow Gerrit-Reviewer: Murtadha Hubail Gerrit-Attention: Murtadha Hubail Gerrit-Attention: Ian Maxon Gerrit-Attention: Ali Alsuliman Gerrit-Attention: Michael Blow Gerrit-Attention: Hussain Towaileb Gerrit-Comment-Date: Sat, 03 Oct 2026 14:02:04 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes
[M] Change in asterixdb[master]: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits
>From Michael Blow : Michael Blow has posted comments on this change by Michael Blow. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email ) Change subject: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits .. Patch Set 2: Code-Review+1 Verified+1 Verified+1 by hand; the Jenkins -1 comes from asterix-gerrit-cloud-test #7047, and its three failures are unrelated to this change: - feeds/http_feed_json (count 0, expected 2), filters/upsert and filters/delete (BindException: Address already in use) all use port 10001, and http_feed_json started 23 ms after feeds/http_feed, which listens on the same port. A port-reuse race between consecutive feed tests. - http_feed_json passed twice later in the same build, with this change in it. - All 132 library/UDF cases in that run, the area this change touches, passed. - Cloud-test builds 7035-7052 are otherwise clean. The other two reds on patch set 1 (Contrib-2, Integration-Tests-1) were pre-existing failures (cluster-by-member-projection plans; cardinality-estimation/single-collection-queries, failing in 8 of the last 9 redux runs). -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: I45e60290961bdd325bf9734bb8806e2c9357afa9 Gerrit-Change-Number: 21986 Gerrit-PatchSet: 2 Gerrit-Owner: Michael Blow Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins Gerrit-Reviewer: Michael Blow Gerrit-Comment-Date: Sat, 03 Oct 2026 13:57:43 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes
[M] Change in asterixdb[master]: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits
>From Michael Blow : Attention is currently required from: Michael Blow. Michael Blow has removed a vote from this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email ) Change subject: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits .. Removed Verified-1 by Jenkins -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: deleteVote Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: I45e60290961bdd325bf9734bb8806e2c9357afa9 Gerrit-Change-Number: 21986 Gerrit-PatchSet: 2 Gerrit-Owner: Michael Blow Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins Gerrit-Attention: Michael Blow
[M] Change in asterixdb[master]: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits
>From Michael Blow : Attention is currently required from: Michael Blow. Hello Anon. E. Moose #1000171, Jenkins, I'd like you to reexamine a change. Please visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Contrib-2 by Anon. E. Moose #1000171, Integration-Tests-1 by Jenkins Change subject: [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits .. [ASTERIXDB-3936][FUN] Skip inactive partitions in library job splits - user model changes: no - storage format changes: no - interface changes: no Details: ExternalLibraryJobUtils built the create/drop library jobs over every registered cluster partition, active or not. A failed node's partitions stay registered, deactivated, until the node is removed or rejoins, and in a cloud deployment, where compute partitions are fixed, nothing takes them over. So after a failover the jobs were scheduled on the failed node and rejected with HYR0010 (node does not exist), the abort job the same way, and the library could not be created, replaced or dropped until the node was dealt with, though the cluster was ACTIVE. Ext-ref: MB-74378 Generated-by: Claude Opus 5.5 Change-Id: I45e60290961bdd325bf9734bb8806e2c9357afa9 --- M asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryJobUtils.java A asterixdb/asterix-app/src/test/java/org/apache/asterix/app/external/ExternalLibraryJobUtilsTest.java 2 files changed, 72 insertions(+), 1 deletion(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/86/21986/2 -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21986?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: I45e60290961bdd325bf9734bb8806e2c9357afa9 Gerrit-Change-Number: 21986 Gerrit-PatchSet: 2 Gerrit-Owner: Michael Blow Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins Gerrit-Attention: Michael Blow
