Skip to content

Commit 1d29d7f

Browse files
committed
Merge remote-tracking branch 'origin/master' into groupby-metrics
2 parents 15305b6 + 6275277 commit 1d29d7f

File tree

226 files changed

+7177
-4014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+7177
-4014
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: ./.github/workflows/worker.yml
3030
with:
3131
script: .github/scripts/run_unit-tests -Dtest=!QTest,'${{ matrix.pattern }}' -Dmaven.test.failure.ignore=true
32-
artifact_prefix: "unit-test-reports"
32+
artifact_prefix: "unit-test-reports-jdk${{ matrix.jdk }}"
3333
jdk: ${{ matrix.jdk }}
3434
key: "test-jdk${{ matrix.jdk }}-[${{ matrix.pattern }}]"
3535

@@ -43,17 +43,21 @@ jobs:
4343
name: "test-report"
4444
needs: run-unit-tests
4545
runs-on: ubuntu-latest
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
jdk: [ "17", "21" ]
4650
steps:
4751
- name: Download reports for all unit test jobs
4852
uses: actions/download-artifact@v4
4953
with:
50-
pattern: "unit-test-reports-*"
54+
pattern: "unit-test-reports-jdk${{ matrix.jdk }}*"
5155
path: target/surefire-reports
5256

5357
- name: Publish Test Report
5458
uses: mikepenz/action-junit-report@v5
5559
with:
56-
check_name: "Unit Test Report"
60+
check_name: "Unit Test Report (JDK ${{ matrix.jdk }})"
5761
report_paths: '**/target/surefire-reports/TEST-*.xml'
5862
detailed_summary: true
5963
flaky_summary: true

.github/workflows/cron-job-its.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
strategy:
8989
fail-fast: false
9090
matrix:
91-
testing_group: [ query, query-retry, query-error, security ]
91+
testing_group: [ query, security ]
9292
uses: ./.github/workflows/reusable-standard-its.yml
9393
needs: build
9494
with:

.github/workflows/standard-its.yml

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
strategy:
7979
fail-fast: false
8080
matrix:
81-
testing_group: [query, query-retry, query-error, security, centralized-datasource-schema]
81+
testing_group: [query, security, centralized-datasource-schema]
8282
uses: ./.github/workflows/reusable-standard-its.yml
8383
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.common-extensions == 'true' }}
8484
with:
@@ -112,62 +112,4 @@ jobs:
112112
testing_groups: -Dgroups=custom-coordinator-duties
113113
use_indexer: middleManager
114114
override_config_path: ./environment-configs/test-groups/custom-coordinator-duties
115-
group: custom coordinator duties
116-
117-
integration-k8s-leadership-tests:
118-
needs: changes
119-
name: (Compile=openjdk17, Run=openjdk17, Cluster Build On K8s) ITNestedQueryPushDownTest integration test
120-
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.common-extensions == 'true' }}
121-
runs-on: ubuntu-22.04
122-
env:
123-
MVN: mvn --no-snapshot-updates
124-
MAVEN_SKIP: -P skip-static-checks -Dweb.console.skip=true -Dmaven.javadoc.skip=true
125-
CONFIG_FILE: k8s_run_config_file.json
126-
IT_TEST: -Dit.test=ITNestedQueryPushDownTest
127-
POD_NAME: int-test
128-
POD_NAMESPACE: default
129-
BUILD_DRUID_CLUSTER: true
130-
steps:
131-
- name: Checkout branch
132-
uses: actions/checkout@v4
133-
134-
- name: setup java
135-
uses: actions/setup-java@v4
136-
with:
137-
java-version: '17'
138-
distribution: 'zulu'
139-
140-
# the build step produces SNAPSHOT artifacts into the local maven repository,
141-
# we include github.sha in the cache key to make it specific to that build/jdk
142-
- name: Restore Maven repository
143-
id: maven-restore
144-
uses: actions/cache/restore@v4
145-
with:
146-
path: ~/.m2/repository
147-
key: maven-${{ runner.os }}-17-${{ github.sha }}
148-
restore-keys: setup-java-Linux-maven-${{ hashFiles('**/pom.xml') }}
149-
150-
- name: Maven build
151-
if: steps.maven-restore.outputs.cache-hit != 'true'
152-
run: |
153-
./it.sh ci
154-
155-
- name: Run IT
156-
id: test
157-
timeout-minutes: 90
158-
run: |
159-
set -x
160-
mvn -B -ff install -pl '!web-console' -Pdist,bundle-contrib-exts -Pskip-static-checks,skip-tests -Dmaven.javadoc.skip=true -T1C
161-
# Note: The above command relies on the correct version of the JARs being installed in the local m2 repository.
162-
# For any changes, please rebuild it using the command from the previous step (./it.sh ci).
163-
164-
MAVEN_OPTS='-Xmx2048m' ${MVN} verify -pl integration-tests -P int-tests-config-file ${IT_TEST} ${MAVEN_SKIP} -Dpod.name=${POD_NAME} -Dpod.namespace=${POD_NAMESPACE} -Dbuild.druid.cluster=${BUILD_DRUID_CLUSTER}
165-
166-
- name: Debug on failure
167-
if: ${{ failure() && steps.test.conclusion == 'failure' }}
168-
run: |
169-
for v in broker middlemanager router coordinator historical ; do
170-
echo "------------------------druid-tiny-cluster-"$v"s-0-------------------------";
171-
/usr/local/bin/kubectl logs --tail 1000 druid-tiny-cluster-"$v"s-0 ||:;
172-
/usr/local/bin/kubectl get events | grep druid-tiny-cluster-"$v"s-0 ||:;
173-
done
115+
group: custom coordinator duties

docs/development/extensions-core/k8s-jobs.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ Other configurations required are:
4848
Druid operators can dynamically tune certain features within this extension. You don't need to restart the Overlord
4949
service for these changes to take effect.
5050

51-
Druid can dynamically tune [pod template selection](#pod-template-selection), which allows you to configure the pod
52-
template based on the task to be run. To enable dynamic pod template selection, first configure the
53-
[custom template pod adapter](#custom-template-pod-adapter).
51+
Druid can dynamically tune [pod template selection](#pod-template-selection) and [capacity](#properties). Where capacity refers to `druid.indexer.runner.capacity`.
52+
53+
Pod template selection allows you to configure the pod template based on the task to be run. To enable dynamic pod template selection, first configure the [custom template pod adapter](#custom-template-pod-adapter).
5454

5555
Use the following APIs to view and update the dynamic configuration for the Kubernetes task runner.
5656

@@ -126,7 +126,8 @@ Host: http://ROUTER_IP:ROUTER_PORT
126126
"type": ["index_kafka"]
127127
}
128128
]
129-
}
129+
},
130+
"capacity": 12
130131
}
131132
```
132133
</details>
@@ -135,6 +136,8 @@ Host: http://ROUTER_IP:ROUTER_PORT
135136

136137
Updates the dynamic configuration for the Kubernetes Task Runner
137138

139+
Note: Both `podTemplateSelectStrategy` and `capacity` are optional fields. A POST request may include either, both, or neither.
140+
138141
##### URL
139142

140143
`POST` `/druid/indexer/v1/k8s/taskrunner/executionconfig`
@@ -193,7 +196,8 @@ curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/k8s/taskrunner/executionconf
193196
"type": ["index_kafka"]
194197
}
195198
]
196-
}
199+
},
200+
"capacity": 6
197201
}'
198202
```
199203

@@ -225,7 +229,8 @@ Content-Type: application/json
225229
"type": ["index_kafka"]
226230
}
227231
]
228-
}
232+
},
233+
"capacity": 6
229234
}
230235
```
231236

@@ -309,7 +314,7 @@ Host: http://ROUTER_IP:ROUTER_PORT
309314
"comment": "",
310315
"ip": "127.0.0.1"
311316
},
312-
"payload": "{\"type\": \"default\",\"podTemplateSelectStrategy\":{\"type\": \"taskType\"}",
317+
"payload": "{\"type\": \"default\",\"podTemplateSelectStrategy\":{\"type\": \"taskType\"},\"capacity\":6",
313318
"auditTime": "2024-06-13T20:59:51.622Z"
314319
}
315320
]
@@ -790,7 +795,7 @@ Should you require the needed permissions for interacting across Kubernetes name
790795
| `druid.indexer.runner.annotations` | `JsonObject` | Additional annotations you want to add to peon pod. | `{}` | No |
791796
| `druid.indexer.runner.peonMonitors` | `JsonArray` | Overrides `druid.monitoring.monitors`. Use this property if you don't want to inherit monitors from the Overlord. | `[]` | No |
792797
| `druid.indexer.runner.graceTerminationPeriodSeconds` | `Long` | Number of seconds you want to wait after a sigterm for container lifecycle hooks to complete. Keep at a smaller value if you want tasks to hold locks for shorter periods. | `PT30S` (K8s default) | No |
793-
| `druid.indexer.runner.capacity` | `Integer` | Number of concurrent jobs that can be sent to Kubernetes. | `2147483647` | No |
798+
| `druid.indexer.runner.capacity` | `Integer` | Number of concurrent jobs that can be sent to Kubernetes. Value will be overridden if a dynamic config value has been set. | `2147483647` | No |
794799
| `druid.indexer.runner.cpuCoreInMicro` | `Integer` | Number of CPU micro core for the task. | `1000` | No |
795800
| `druid.indexer.runner.logSaveTimeout` | `Duration` | The peon executing the ingestion task makes a best effort to persist the pod logs from `k8s` to persistent task log storage. The timeout ensures that `k8s` connection issues do not cause the pod to hang indefinitely thereby blocking Overlord operations. If the timeout occurs before the logs are saved, those logs will not be available in Druid. | `PT300S` | NO |
796801

docs/querying/sql-metadata-tables.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ Servers table lists all discovered servers in the cluster.
238238
|start_time|STRING|Timestamp in ISO8601 format when the server was announced in the cluster|
239239
|version|VARCHAR|Druid version running on the server|
240240
|labels|VARCHAR|Labels for the server configured using the property [`druid.labels`](../configuration/index.md)|
241+
|available_processors|BIGINT|Total number of CPU processors available to the server|
242+
|total_memory|BIGINT|Total memory in bytes available to the server|
241243

242244
To retrieve information about all servers, use the query:
243245

embedded-tests/src/test/java/org/apache/druid/testing/embedded/auth/AbstractAuthConfigurationTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,9 +1018,8 @@ protected String getBrokerUrl()
10181018

10191019
/**
10201020
* curr_size on historicals changes because cluster state is not isolated across
1021-
* different
1022-
* integration tests, zero it out for consistent test results
1023-
* version and start_time are not configurable therefore we zero them as well
1021+
* different integration tests, zero it out for consistent test results.
1022+
* version, start_time, available_processors, total_memory are not configurable therefore we zero them as well
10241023
*/
10251024
protected static List<Map<String, Object>> getServersWithoutNonConfigurableFields(List<Map<String, Object>> servers)
10261025
{
@@ -1031,6 +1030,8 @@ protected static List<Map<String, Object>> getServersWithoutNonConfigurableField
10311030
newServer.put("curr_size", 0);
10321031
newServer.put("start_time", "0");
10331032
newServer.put("version", "0.0.0");
1033+
newServer.put("available_processors", 0);
1034+
newServer.put("total_memory", 0);
10341035
return newServer;
10351036
}
10361037
);

embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/KafkaClusterMetricsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
import org.junit.jupiter.api.Test;
5252
import org.junit.jupiter.api.Timeout;
5353

54-
import java.util.List;
5554
import java.util.Map;
5655
import java.util.Set;
5756
import java.util.stream.Collectors;
@@ -154,7 +153,8 @@ public void test_ingest10kRows_ofSelfClusterMetrics_andVerifyValues()
154153
// Wait for segments to be handed off
155154
indexer.latchableEmitter().waitForEventAggregate(
156155
event -> event.hasMetricName("ingest/handoff/count")
157-
.hasDimension(DruidMetrics.DATASOURCE, List.of(dataSource)),
156+
.hasDimension(DruidMetrics.DATASOURCE, dataSource)
157+
.hasDimension(DruidMetrics.SUPERVISOR_ID, supervisorId),
158158
agg -> agg.hasSumAtLeast(expectedSegmentsHandedOff)
159159
);
160160

embedded-tests/src/test/java/org/apache/druid/testing/embedded/msq/EmbeddedMSQRealtimeQueryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ protected void setupLookups() throws Exception
145145
// Wait for it to be loaded.
146146
indexer.latchableEmitter().waitForEventAggregate(
147147
event -> event.hasMetricName("ingest/events/processed")
148-
.hasDimension(DruidMetrics.DATASOURCE, Collections.singletonList(dataSource)),
148+
.hasDimension(DruidMetrics.DATASOURCE, dataSource),
149149
agg -> agg.hasSumAtLeast(totalRows)
150150
);
151151
broker.latchableEmitter().waitForEvent(

embedded-tests/src/test/java/org/apache/druid/testing/embedded/msq/EmbeddedMSQRealtimeUnnestQueryTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.junit.jupiter.api.Test;
3838
import org.junit.jupiter.api.Timeout;
3939

40-
import java.util.Collections;
4140
import java.util.List;
4241

4342
public class EmbeddedMSQRealtimeUnnestQueryTest extends BaseRealtimeQueryTest
@@ -98,7 +97,7 @@ void setupAll()
9897
// Wait for it to be loaded.
9998
indexer.latchableEmitter().waitForEventAggregate(
10099
event -> event.hasMetricName("ingest/events/processed")
101-
.hasDimension(DruidMetrics.DATASOURCE, Collections.singletonList(dataSource)),
100+
.hasDimension(DruidMetrics.DATASOURCE, dataSource),
102101
agg -> agg.hasSumAtLeast(totalRows)
103102
);
104103
}

0 commit comments

Comments
 (0)