Skip to content

KAFKA-17570: Rewrite StressTestLog by Java#17249

Merged
chia7712 merged 3 commits into
apache:trunkfrom
frankvicky:KAFKA-17570
Nov 9, 2024
Merged

KAFKA-17570: Rewrite StressTestLog by Java#17249
chia7712 merged 3 commits into
apache:trunkfrom
frankvicky:KAFKA-17570

Conversation

@frankvicky

Copy link
Copy Markdown
Contributor

JIRA: KAFKA-17570

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@github-actions github-actions Bot added core Kafka Broker performance labels Sep 22, 2024
@frankvicky frankvicky marked this pull request as draft September 22, 2024 09:20

@chia7712 chia7712 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frankvicky Except for read/write test, could you please test write + read mixed?

}
}

abstract class WorkerThread extends Thread {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please use @Threads instead

}
}

class ReaderThread extends WorkerThread {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please rewrite it by @Threads?


@Override
public void work() {
Records read = log.read(currentOffset, 1, FetchIsolation.LOG_END, true).records;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this test case, we should prepare a log with data before testing read.

@chia7712

Copy link
Copy Markdown
Member

@frankvicky Could you please rewrite it by java like #17246?

@frankvicky frankvicky marked this pull request as ready for review November 2, 2024 06:42
@frankvicky frankvicky force-pushed the KAFKA-17570 branch 5 times, most recently from 24309a5 to 66c7a2b Compare November 2, 2024 07:12
@chia7712

chia7712 commented Nov 4, 2024

Copy link
Copy Markdown
Member

@frankvicky could you please attach the result ?

@frankvicky

Copy link
Copy Markdown
Contributor Author

Hi @chia7712
I have let it run for a while, here is the result:

Reader offset = 14000, writer offset = 14000
Reader offset = 26853, writer offset = 29000
Reader offset = 42000, writer offset = 42000
Reader offset = 59748, writer offset = 60000
Reader offset = 77000, writer offset = 77000
Reader offset = 94569, writer offset = 95000
Reader offset = 112008, writer offset = 112123
Reader offset = 130000, writer offset = 130000
Reader offset = 147707, writer offset = 148000
Reader offset = 165212, writer offset = 166000
Reader offset = 183000, writer offset = 183000
Reader offset = 200749, writer offset = 201000
Reader offset = 218000, writer offset = 218000
Reader offset = 235484, writer offset = 236000
Reader offset = 253000, writer offset = 253000
Reader offset = 271000, writer offset = 271000
Reader offset = 287721, writer offset = 288000
Reader offset = 304000, writer offset = 304005
Reader offset = 319234, writer offset = 320000
Reader offset = 336628, writer offset = 337000
Reader offset = 353424, writer offset = 354000
Reader offset = 370000, writer offset = 370000
Reader offset = 387053, writer offset = 387855
Reader offset = 404005, writer offset = 404129
Reader offset = 421521, writer offset = 422000
Reader offset = 439057, writer offset = 440000
Reader offset = 456800, writer offset = 457000
Reader offset = 472000, writer offset = 472000
Reader offset = 489473, writer offset = 490000
Reader offset = 507000, writer offset = 507000
Reader offset = 524000, writer offset = 524000
Reader offset = 541160, writer offset = 542000
Reader offset = 558988, writer offset = 559000
Reader offset = 576000, writer offset = 576000
Reader offset = 593682, writer offset = 594000
Reader offset = 611000, writer offset = 611000
Reader offset = 628000, writer offset = 628000
Reader offset = 645873, writer offset = 646000
Reader offset = 663062, writer offset = 664000
Reader offset = 680976, writer offset = 681000
Reader offset = 698000, writer offset = 698000
Reader offset = 716000, writer offset = 716000
Reader offset = 733000, writer offset = 733000
Reader offset = 750000, writer offset = 750000
Reader offset = 768000, writer offset = 768000
Reader offset = 785029, writer offset = 785520
Reader offset = 802484, writer offset = 803000
Reader offset = 820000, writer offset = 820000
Reader offset = 837000, writer offset = 837000
Reader offset = 854000, writer offset = 854000
Reader offset = 871228, writer offset = 872000
Reader offset = 888000, writer offset = 888000
Reader offset = 899547, writer offset = 902000
Reader offset = 917766, writer offset = 918000
Reader offset = 935000, writer offset = 935000
Reader offset = 953000, writer offset = 953000
Reader offset = 970000, writer offset = 970000
Reader offset = 987614, writer offset = 988000
Reader offset = 1005273, writer offset = 1006000
Reader offset = 1022153, writer offset = 1023000
Reader offset = 1039464, writer offset = 1040000
Reader offset = 1057000, writer offset = 1057000
Reader offset = 1074382, writer offset = 1075000
Reader offset = 1092000, writer offset = 1092000
Reader offset = 1110000, writer offset = 1110000
Reader offset = 1126000, writer offset = 1126000
Reader offset = 1143808, writer offset = 1144000
Reader offset = 1161000, writer offset = 1161000
Reader offset = 1177626, writer offset = 1178508
Reader offset = 1195133, writer offset = 1196000
Reader offset = 1213000, writer offset = 1213000
Reader offset = 1230743, writer offset = 1231000
Reader offset = 1248000, writer offset = 1248000
Reader offset = 1266000, writer offset = 1266000
Reader offset = 1283463, writer offset = 1284000
Reader offset = 1301000, writer offset = 1301000
Reader offset = 1318655, writer offset = 1319000
Reader offset = 1336535, writer offset = 1337000
Reader offset = 1353000, writer offset = 1353000
Reader offset = 1371000, writer offset = 1371000
Reader offset = 1388315, writer offset = 1389000
Reader offset = 1402628, writer offset = 1405000
Reader offset = 1413757, writer offset = 1418046

@frankvicky frankvicky changed the title KAFKA-17570: Rewrite StressTestLog by JMH KAFKA-17570: Rewrite StressTestLog by Java Nov 8, 2024
@chia7712 chia7712 merged commit 4e3a3d3 into apache:trunk Nov 9, 2024
chiacyu pushed a commit to chiacyu/kafka that referenced this pull request Nov 30, 2024
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
eduwercamacaro added a commit to littlehorse-enterprises/kafka that referenced this pull request Dec 17, 2024
* KAFKA-17926 Improve the documentation explaining why max.in.flight.requests.per.connection should not exceed 5 (apache#17719)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

* MINOR: Cleanup GroupCoordinatorRecordHelpers (apache#17718)

Reviewers: Jeff Kim <jeff.kim@confluent.io>, Mickael Maison <mickael.maison@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>

* rebase to fix merge conflict (apache#17702)

Fixes an issue with the TTD in the specific case where users don't specify an initial time for the driver and also don't specify a start timestamp for the TestInputTopic, then pipe input records without timestamps. This combination results in a slight mismatch in the expected timestamps for the piped records, which can be noticeable when writing tests with very small time deltas.

The problem is that, while both the TTD and the TestInputTopic will be initialized to the "current time" when not otherwise specified, it's possible for some milliseconds to have passed between the creation of the TTD and the creation of the TestInputTopic. This can result in a TestInputTopic getting a start timestamp that's several ms larger than the driver's time, and ultimately causing the piped input records to have timestamps slightly in the future relative to the driver.

In practice even those who hit this issue might not notice it if they aren't manipulating time in their tests, or are advancing time by enough to negate the several-milliseconds of difference. However we noticed a test fail due to this because we were testing a ttl-based processor and had advanced the driver time by only 1 millisecond past the ttl. The piped record should have been expired, but because it's timestamp was a few milliseconds longer than the driver's start time, this test ended up failing.

Reviewers: Matthias Sax <mjsax@apache.org>, Bruno Cadonna <cadonna@apache.org>, Lucas Brutschy < lbrutschy@confluent.io>

* KAFKA-17801: RemoteLogManager may compute inaccurate upperBoundOffset for aborted txns (apache#17676)

Reviewers: Jun Rao <junrao@gmail.com>

* MINOR: log fix in SnapshottableCoordinator (apache#17726)

Reviewers: donaldzhu-cc, Chia-Ping Tsai <chia7712@gmail.com>

* KAFKA-17570 Rewrite StressTestLog by Java (apache#17249)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

* MINOR: Delete unused member from KafkaAdminClient (apache#17729)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

* KAFKA-17970 Moving some share purgatory classes from core to share module (apache#17722)

As part of PR: apache#17636 where purgatory has been moved from core to server-common hence move some existing classes used in Share Fetch to Share module.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

* KAFKA-17837 Rewrite DeleteTopicTest (apache#17579)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

* MINOR: Move StopPartition to server-common (apache#17704)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

* KAFKA-15549 Bump swagger dependency version from 2.2.8 to 2.2.25 (apache#17730)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

* KAFKA-17872: Update consumed offsets on records with invalid timestamp (apache#17710)

TimestampExtractor allows to drop records by returning a timestamp of -1. For this case, we still need to update consumed offsets to allows us to commit progress.

Reviewers: Bill Bejeck <bill@confluent.io>

* KAFKA-17925 Convert Kafka Client integration tests to use KRaft (apache#17670)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>

* KAFKA-17779: Fix flaky RemoteLogManager test (apache#17724)

Reviewers: Kamal Chandraprakash <kamal.chandraprakash@gmail.com>

* KAFKA-17455: fixes stuck producer by polling again after pollDelayMs in NetworkUtils#awaitReady()

* clarifies comments

* attempts to add test

* Adds a test but my changes to MockClient.java broke all sorts of stuff

* test that passes on my branch and fails on trunk

* addresses PR feedback: rename MockClient#setAdvanceTimeDuringPoll to advanceTimeDuringPoll()

---------

Co-authored-by: PoAn Yang <payang@apache.org>
Co-authored-by: David Jacot <djacot@confluent.io>
Co-authored-by: A. Sophie Blee-Goldman <ableegoldman@gmail.com>
Co-authored-by: Kamal Chandraprakash <kamal.chandraprakash@gmail.com>
Co-authored-by: Jeff Kim <kimkb2011@gmail.com>
Co-authored-by: TengYao Chi <kitingiao@gmail.com>
Co-authored-by: Apoorv Mittal <apoorvmittal10@gmail.com>
Co-authored-by: Mickael Maison <mimaison@users.noreply.github.com>
Co-authored-by: Yung <yungyung7654321@gmail.com>
Co-authored-by: Matthias J. Sax <matthias@confluent.io>
Co-authored-by: Kirk True <kirk@kirktrue.pro>
Co-authored-by: wperlichek <61857706+wperlichek@users.noreply.github.com>
Co-authored-by: Colt McNealy <colt@littlehorse.io>
tedyu pushed a commit to tedyu/kafka that referenced this pull request Jan 6, 2025
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants