kafka/checkstyle
Nick Telford 571f50817c
KAFKA-17411: Create local state Standbys on start (#16922)
Instead of waiting until Tasks are assigned to us, we pre-emptively
create a StandbyTask for each non-empty Task directory found on-disk.

We do this before starting any StreamThreads, and on our first
assignment (after joining the consumer group), we recycle any of these
StandbyTasks that were assigned to us, either as an Active or a
Standby.

We can't just use these "initial Standbys" as-is, because they were
constructed outside the context of a StreamThread, so we first have to
update them with the context (log context, ChangelogReader, and source
topics) of the thread that it has been assigned to.

The motivation for this is to (in a later commit) read StateStore
offsets for unowned Tasks from the StateStore itself, rather than the
.checkpoint file, which we plan to deprecate and remove.

There are a few additional benefits:

Initializing these Tasks on start-up, instead of on-assignment, will
reduce the time between a member joining the consumer group and beginning
processing. This is especially important when active tasks are being moved
over, for example, as part of a rolling restart.

If a Task has corrupt data on-disk, it will be discovered on startup and
wiped under EOS. This is preferable to wiping the state after being
assigned the Task, because another instance may have non-corrupt data and
would not need to restore (as much).

There is a potential performance impact: we open all on-disk Task
StateStores, and keep them all open until we have our first assignment.
This could require large amounts of memory, in particular when there are
a large number of local state stores on-disk.

However, since old local state for Tasks we don't own is automatically
cleaned up after a period of time, in practice, we will almost always
only be dealing with the state that was last assigned to the local
instance.

Reviewers: Anna Sophie Blee-Goldman <ableegoldman@apache.org>, Bruno Cadonna <cadonna@apache.org>, Matthias Sax <mjsax@apache.org>
2024-10-29 12:59:25 -07:00
..
.scalafmt.conf MINOR: Update to Scala 2.13.12 (#14430) 2023-09-24 06:05:12 -07:00
checkstyle.xml KAFKA-16643 Add ModifierOrder checkstyle rule (#15890) 2024-06-13 15:39:32 +08:00
import-control-coordinator-common.xml KAFKA-17367: Introduce share coordinator [2/N] (#17011) 2024-09-09 20:01:24 -04:00
import-control-core.xml KAFKA-8779 Fix flaky tests introduced by dynamic log levels (#17382) 2024-10-24 21:39:35 +08:00
import-control-group-coordinator.xml KAFKA-16379; Coordinator event queue, processing, flush, purgatory time histograms (#16949) 2024-08-23 04:53:22 -07:00
import-control-jmh-benchmarks.xml KAFKA-17568 Rewrite TestPurgatoryPerformance by Java (#17246) 2024-10-24 02:44:37 +08:00
import-control-metadata.xml KAFKA-16518: Implement KIP-853 flags for storage-tool.sh (#16669) 2024-08-02 15:47:45 -07:00
import-control-server-common.xml KAFKA-15853 Move KafkaConfig log properties and docs out of core (#15569) 2024-04-20 04:14:23 +08:00
import-control-server.xml KAFKA-17563 Move `RequestConvertToJson` to server module (#17223) 2024-09-27 02:19:47 +08:00
import-control-share-coordinator.xml KAFKA-17367: Share coordinator persistent batch merging algorithm. [3/N] (#17149) 2024-10-02 11:30:51 -04:00
import-control-share.xml KAFKA-17329: DefaultStatePersister implementation (#17270) 2024-10-28 14:11:04 -04:00
import-control-storage.xml KAFKA-17589 Move JUnit extensions to test-common module (#17318) 2024-10-03 10:28:37 +08:00
import-control-test-common-api.xml KAFKA-17706 Allow all imports for test-common and test-common-api (#17378) 2024-10-06 14:02:10 +08:00
import-control-test-common.xml KAFKA-17706 Allow all imports for test-common and test-common-api (#17378) 2024-10-06 14:02:10 +08:00
import-control-transaction-coordinator.xml KAFKA-17199 Add UT for TransactionLogConfig and TransactionStateManagerConfig (#17442) 2024-10-12 09:42:54 +08:00
import-control.xml KAFKA-16845 Migrate ReplicationQuotasTestRig to new test infra (#17089) 2024-10-25 03:33:01 +08:00
java.header MINOR: improve license header check by providing head file instead of (prefix) header regex 2017-02-28 12:35:04 -08:00
suppressions.xml KAFKA-17411: Create local state Standbys on start (#16922) 2024-10-29 12:59:25 -07:00