2023-04-18 05:52:28 +08:00
|
|
|
<!DOCTYPE import-control PUBLIC
|
|
|
|
"-//Puppy Crawl//DTD Import Control 1.1//EN"
|
|
|
|
"http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
|
|
|
|
<!--
|
|
|
|
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.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<import-control pkg="org.apache.kafka">
|
|
|
|
|
|
|
|
<!-- THINK HARD ABOUT THE LAYERING OF THE PROJECT BEFORE CHANGING THIS FILE -->
|
|
|
|
|
|
|
|
<!-- common library dependencies -->
|
|
|
|
<allow pkg="java" />
|
|
|
|
<allow pkg="javax.management" />
|
|
|
|
<allow pkg="org.slf4j" />
|
|
|
|
<allow pkg="org.junit" />
|
|
|
|
<allow pkg="org.mockito" />
|
|
|
|
<allow pkg="java.security" />
|
|
|
|
<allow pkg="javax.net.ssl" />
|
|
|
|
<allow pkg="javax.security" />
|
2023-08-20 02:01:08 +08:00
|
|
|
<allow pkg="javax.crypto" />
|
2023-04-18 05:52:28 +08:00
|
|
|
<allow pkg="net.jqwik.api" />
|
|
|
|
|
|
|
|
<!-- no one depends on the server -->
|
|
|
|
<disallow pkg="kafka" />
|
|
|
|
|
|
|
|
<!-- anyone can use public classes -->
|
|
|
|
<allow pkg="org.apache.kafka.common" exact-match="true" />
|
|
|
|
<allow pkg="org.apache.kafka.common.security" />
|
|
|
|
<allow pkg="org.apache.kafka.common.serialization" />
|
|
|
|
<allow pkg="org.apache.kafka.common.utils" />
|
|
|
|
<allow pkg="org.apache.kafka.common.errors" exact-match="true" />
|
|
|
|
<allow pkg="org.apache.kafka.common.memory" />
|
2025-01-24 22:03:43 +08:00
|
|
|
<allow pkg="org.apache.kafka.common.test.api" />
|
2023-04-18 05:52:28 +08:00
|
|
|
|
|
|
|
<!-- persistent collection factories/non-library-specific wrappers -->
|
|
|
|
<allow pkg="org.apache.kafka.server.immutable" exact-match="true" />
|
|
|
|
|
|
|
|
<subpackage name="common">
|
|
|
|
<subpackage name="metadata">
|
|
|
|
<allow pkg="com.fasterxml.jackson" />
|
|
|
|
<allow pkg="org.apache.kafka.common.protocol" />
|
|
|
|
<allow pkg="org.apache.kafka.common.protocol.types" />
|
|
|
|
<allow pkg="org.apache.kafka.common.message" />
|
|
|
|
<allow pkg="org.apache.kafka.common.metadata" />
|
|
|
|
</subpackage>
|
2023-11-02 21:46:05 +08:00
|
|
|
<subpackage name="errors">
|
|
|
|
<allow pkg="org.apache.kafka.common.metadata" />
|
|
|
|
</subpackage>
|
2023-04-18 05:52:28 +08:00
|
|
|
</subpackage>
|
|
|
|
|
|
|
|
<subpackage name="controller">
|
|
|
|
<allow pkg="org.apache.kafka.clients" />
|
|
|
|
<allow pkg="org.apache.kafka.clients.admin" />
|
|
|
|
<allow pkg="org.apache.kafka.common.acl" />
|
|
|
|
<allow pkg="org.apache.kafka.common.annotation" />
|
|
|
|
<allow pkg="org.apache.kafka.common.config" />
|
|
|
|
<allow pkg="org.apache.kafka.common.feature" />
|
|
|
|
<allow pkg="org.apache.kafka.common.internals" />
|
|
|
|
<allow pkg="org.apache.kafka.common.message" />
|
|
|
|
<allow pkg="org.apache.kafka.common.metadata" />
|
|
|
|
<allow pkg="org.apache.kafka.common.network" />
|
|
|
|
<allow pkg="org.apache.kafka.common.protocol" />
|
|
|
|
<allow pkg="org.apache.kafka.common.quota" />
|
|
|
|
<allow pkg="org.apache.kafka.common.requests" />
|
|
|
|
<allow pkg="org.apache.kafka.common.resource" />
|
|
|
|
<allow pkg="org.apache.kafka.controller" />
|
|
|
|
<allow pkg="org.apache.kafka.image" />
|
|
|
|
<allow pkg="org.apache.kafka.image.writer" />
|
|
|
|
<allow pkg="org.apache.kafka.metadata" />
|
|
|
|
<allow pkg="org.apache.kafka.metadata.authorizer" />
|
|
|
|
<allow pkg="org.apache.kafka.metadata.migration" />
|
|
|
|
<allow pkg="org.apache.kafka.metalog" />
|
2023-04-21 17:19:04 +08:00
|
|
|
<allow pkg="org.apache.kafka.deferred" />
|
2023-04-18 05:52:28 +08:00
|
|
|
<allow pkg="org.apache.kafka.queue" />
|
|
|
|
<allow pkg="org.apache.kafka.raft" />
|
|
|
|
<allow pkg="org.apache.kafka.server.authorizer" />
|
|
|
|
<allow pkg="org.apache.kafka.server.common" />
|
|
|
|
<allow pkg="org.apache.kafka.server.config" />
|
|
|
|
<allow pkg="org.apache.kafka.server.fault" />
|
KAFKA-14996: Handle overly large user operations on the kcontroller (#13742)
Previously, if a user tried to perform an overly large batch operation on the KRaft controller
(such as creating a million topics), we would create a very large number of records in memory. Our
attempt to write these records to the Raft layer would fail, because there were too many to fit in
an atomic batch. This failure, in turn, would trigger a controller failover.
(Note: I am assuming here that no topic creation policy was in place that would prevent the
creation of a million topics. I am also assuming that the user operation must be done atomically,
which is true for all current user operations, since we have not implemented KIP-868 yet.)
With this PR, we fail immediately when the number of records we have generated exceeds the
threshold that we can apply. This failure does not generate a controller failover. We also now
fail with a PolicyViolationException rather than an UnknownServerException.
In order to implement this in a simple way, this PR adds the BoundedList class, which wraps any
list and adds a maximum length. Attempts to grow the list beyond this length cause an exception to
be thrown.
Reviewers: David Arthur <mumrah@gmail.com>, Ismael Juma <ijuma@apache.org>, Divij Vaidya <diviv@amazon.com>
2023-05-27 04:16:17 +08:00
|
|
|
<allow pkg="org.apache.kafka.server.mutable" />
|
2023-04-18 05:52:28 +08:00
|
|
|
<allow pkg="org.apache.kafka.server.policy"/>
|
|
|
|
<allow pkg="org.apache.kafka.server.util"/>
|
|
|
|
<allow pkg="org.apache.kafka.snapshot" />
|
|
|
|
<allow pkg="org.apache.kafka.test" />
|
|
|
|
<allow pkg="org.apache.kafka.timeline" />
|
KAFKA-15183: Add more controller, loader, snapshot emitter metrics (#14010)
Implement some of the metrics from KIP-938: Add more metrics for
measuring KRaft performance.
Add these metrics to QuorumControllerMetrics:
kafka.controller:type=KafkaController,name=TimedOutBrokerHeartbeatCount
kafka.controller:type=KafkaController,name=EventQueueOperationsStartedCount
kafka.controller:type=KafkaController,name=EventQueueOperationsTimedOutCount
kafka.controller:type=KafkaController,name=NewActiveControllersCount
Create LoaderMetrics with these new metrics:
kafka.server:type=MetadataLoader,name=CurrentMetadataVersion
kafka.server:type=MetadataLoader,name=HandleLoadSnapshotCount
Create SnapshotEmitterMetrics with these new metrics:
kafka.server:type=SnapshotEmitter,name=LatestSnapshotGeneratedBytes
kafka.server:type=SnapshotEmitter,name=LatestSnapshotGeneratedAgeMs
Reviewers: Ron Dagostino <rndgstn@gmail.com>
2023-07-25 12:13:58 +08:00
|
|
|
<subpackage name="metrics">
|
|
|
|
<allow pkg="com.yammer.metrics"/>
|
|
|
|
<allow pkg="org.apache.kafka.common.metrics" />
|
|
|
|
<allow pkg="org.apache.kafka.server.metrics" />
|
|
|
|
</subpackage>
|
2023-04-18 05:52:28 +08:00
|
|
|
</subpackage>
|
|
|
|
|
|
|
|
<subpackage name="image">
|
|
|
|
<allow pkg="org.apache.kafka.common.config" />
|
|
|
|
<allow pkg="org.apache.kafka.common.message" />
|
|
|
|
<allow pkg="org.apache.kafka.common.metadata" />
|
|
|
|
<allow pkg="org.apache.kafka.common.protocol" />
|
|
|
|
<allow pkg="org.apache.kafka.common.quota" />
|
|
|
|
<allow pkg="org.apache.kafka.common.record" />
|
|
|
|
<allow pkg="org.apache.kafka.common.requests" />
|
|
|
|
<allow pkg="org.apache.kafka.common.resource" />
|
|
|
|
<allow pkg="org.apache.kafka.image" />
|
|
|
|
<allow pkg="org.apache.kafka.image.writer" />
|
|
|
|
<allow pkg="org.apache.kafka.metadata" />
|
|
|
|
<allow pkg="org.apache.kafka.queue" />
|
|
|
|
<allow pkg="org.apache.kafka.clients.admin" />
|
|
|
|
<allow pkg="org.apache.kafka.raft" />
|
|
|
|
<allow pkg="org.apache.kafka.server.common" />
|
2024-04-24 13:05:18 +08:00
|
|
|
<allow pkg="org.apache.kafka.server.config" />
|
2023-04-18 05:52:28 +08:00
|
|
|
<allow pkg="org.apache.kafka.server.fault" />
|
|
|
|
<allow pkg="org.apache.kafka.server.util" />
|
|
|
|
<allow pkg="org.apache.kafka.snapshot" />
|
|
|
|
<allow pkg="org.apache.kafka.test" />
|
KAFKA-15183: Add more controller, loader, snapshot emitter metrics (#14010)
Implement some of the metrics from KIP-938: Add more metrics for
measuring KRaft performance.
Add these metrics to QuorumControllerMetrics:
kafka.controller:type=KafkaController,name=TimedOutBrokerHeartbeatCount
kafka.controller:type=KafkaController,name=EventQueueOperationsStartedCount
kafka.controller:type=KafkaController,name=EventQueueOperationsTimedOutCount
kafka.controller:type=KafkaController,name=NewActiveControllersCount
Create LoaderMetrics with these new metrics:
kafka.server:type=MetadataLoader,name=CurrentMetadataVersion
kafka.server:type=MetadataLoader,name=HandleLoadSnapshotCount
Create SnapshotEmitterMetrics with these new metrics:
kafka.server:type=SnapshotEmitter,name=LatestSnapshotGeneratedBytes
kafka.server:type=SnapshotEmitter,name=LatestSnapshotGeneratedAgeMs
Reviewers: Ron Dagostino <rndgstn@gmail.com>
2023-07-25 12:13:58 +08:00
|
|
|
<subpackage name="loader">
|
|
|
|
<subpackage name="metrics">
|
|
|
|
<allow pkg="com.yammer.metrics"/>
|
|
|
|
<allow pkg="org.apache.kafka.common.metrics" />
|
|
|
|
<allow pkg="org.apache.kafka.controller.metrics" />
|
|
|
|
<allow pkg="org.apache.kafka.server.metrics" />
|
|
|
|
</subpackage>
|
|
|
|
</subpackage>
|
|
|
|
<subpackage name="publisher">
|
|
|
|
<subpackage name="metrics">
|
|
|
|
<allow pkg="com.yammer.metrics"/>
|
|
|
|
<allow pkg="org.apache.kafka.common.metrics" />
|
|
|
|
<allow pkg="org.apache.kafka.controller.metrics" />
|
|
|
|
<allow pkg="org.apache.kafka.server.metrics" />
|
|
|
|
</subpackage>
|
|
|
|
</subpackage>
|
2023-04-18 05:52:28 +08:00
|
|
|
</subpackage>
|
|
|
|
|
|
|
|
<subpackage name="metadata">
|
|
|
|
<allow pkg="org.apache.kafka.clients" />
|
|
|
|
<allow pkg="org.apache.kafka.common.acl" />
|
|
|
|
<allow pkg="org.apache.kafka.common.annotation" />
|
|
|
|
<allow pkg="org.apache.kafka.common.config" />
|
|
|
|
<allow pkg="org.apache.kafka.common.message" />
|
|
|
|
<allow pkg="org.apache.kafka.common.metadata" />
|
|
|
|
<allow pkg="org.apache.kafka.common.protocol" />
|
2023-05-01 21:56:04 +08:00
|
|
|
<allow pkg="org.apache.kafka.common.quota" />
|
2023-04-18 05:52:28 +08:00
|
|
|
<allow pkg="org.apache.kafka.common.record" />
|
|
|
|
<allow pkg="org.apache.kafka.common.resource" />
|
|
|
|
<allow pkg="org.apache.kafka.common.requests" />
|
|
|
|
<allow pkg="org.apache.kafka.image" />
|
|
|
|
<allow pkg="org.apache.kafka.metadata" />
|
|
|
|
<allow pkg="org.apache.kafka.metalog" />
|
|
|
|
<allow pkg="org.apache.kafka.queue" />
|
|
|
|
<allow pkg="org.apache.kafka.raft" />
|
|
|
|
<allow pkg="org.apache.kafka.server.authorizer" />
|
|
|
|
<allow pkg="org.apache.kafka.server.common" />
|
|
|
|
<allow pkg="org.apache.kafka.server.fault" />
|
|
|
|
<allow pkg="org.apache.kafka.server.config" />
|
|
|
|
<allow pkg="org.apache.kafka.server.util"/>
|
|
|
|
<allow pkg="org.apache.kafka.test" />
|
|
|
|
<subpackage name="authorizer">
|
|
|
|
<allow pkg="org.apache.kafka.common.acl" />
|
|
|
|
<allow pkg="org.apache.kafka.common.requests" />
|
|
|
|
<allow pkg="org.apache.kafka.common.resource" />
|
|
|
|
<allow pkg="org.apache.kafka.controller" />
|
|
|
|
<allow pkg="org.apache.kafka.metadata" />
|
|
|
|
<allow pkg="org.apache.kafka.common.internals" />
|
|
|
|
</subpackage>
|
|
|
|
<subpackage name="bootstrap">
|
|
|
|
<allow pkg="org.apache.kafka.snapshot" />
|
|
|
|
</subpackage>
|
|
|
|
<subpackage name="fault">
|
|
|
|
<allow pkg="org.apache.kafka.server.fault" />
|
|
|
|
</subpackage>
|
2024-05-21 23:58:49 +08:00
|
|
|
<subpackage name="migration">
|
|
|
|
<allow pkg="org.apache.kafka.controller" />
|
|
|
|
</subpackage>
|
KAFKA-16518: Implement KIP-853 flags for storage-tool.sh (#16669)
As part of KIP-853, storage-tool.sh now has two new flags: --standalone, and --initial-voters. This PR implements these two flags in storage-tool.sh.
There are currently two valid ways to format a cluster:
The pre-KIP-853 way, where you use a statically configured controller quorum. In this case, neither --standalone nor --initial-voters may be specified, and kraft.version must be set to 0.
The KIP-853 way, where one of --standalone and --initial-voters must be specified with the initial value of the dynamic controller quorum. In this case, kraft.version must be set to 1.
This PR moves the formatting logic out of StorageTool.scala and into Formatter.java. The tool file was never intended to get so huge, or to implement complex logic like generating metadata records. Those things should be done by code in the metadata or raft gradle modules. This is also useful for junit tests, which often need to do formatting. (The 'info' and 'random-uuid' commands remain in StorageTool.scala, for now.)
Reviewers: José Armando García Sancio <jsancio@apache.org>
2024-08-03 06:47:45 +08:00
|
|
|
<subpackage name="storage">
|
|
|
|
<allow pkg="org.apache.kafka.common.internals" />
|
|
|
|
<allow pkg="org.apache.kafka.snapshot" />
|
|
|
|
</subpackage>
|
2024-05-21 23:58:49 +08:00
|
|
|
<subpackage name="util">
|
|
|
|
<allow class="org.apache.kafka.common.compress.Compression" exact-match="true" />
|
|
|
|
</subpackage>
|
2023-04-18 05:52:28 +08:00
|
|
|
</subpackage>
|
|
|
|
|
|
|
|
<subpackage name="metalog">
|
2024-05-21 23:58:49 +08:00
|
|
|
<allow class="org.apache.kafka.common.compress.Compression" exact-match="true" />
|
2023-04-18 05:52:28 +08:00
|
|
|
<allow pkg="org.apache.kafka.common.metadata" />
|
|
|
|
<allow pkg="org.apache.kafka.common.protocol" />
|
|
|
|
<allow pkg="org.apache.kafka.common.record" />
|
|
|
|
<allow pkg="org.apache.kafka.metadata" />
|
|
|
|
<allow pkg="org.apache.kafka.metalog" />
|
|
|
|
<allow pkg="org.apache.kafka.raft" />
|
|
|
|
<allow pkg="org.apache.kafka.snapshot" />
|
|
|
|
<allow pkg="org.apache.kafka.queue" />
|
|
|
|
<allow pkg="org.apache.kafka.server.common" />
|
|
|
|
<allow pkg="org.apache.kafka.test" />
|
|
|
|
</subpackage>
|
|
|
|
|
|
|
|
</import-control>
|