Skip to content

KAFKA-19752: Move UnifiedLogTest to storage module#21761

Open
TaiJuWu wants to merge 8 commits intoapache:trunkfrom
TaiJuWu:KAFKA-19752-1
Open

KAFKA-19752: Move UnifiedLogTest to storage module#21761
TaiJuWu wants to merge 8 commits intoapache:trunkfrom
TaiJuWu:KAFKA-19752-1

Conversation

@TaiJuWu
Copy link
Collaborator

@TaiJuWu TaiJuWu commented Mar 15, 2026

testFetchEarliestPendingUploadTimestampNoRemoteStorage ~
testTransactionIndexUpdated part.

@github-actions github-actions bot added triage PRs from the community storage Pull requests that target the storage module labels Mar 15, 2026
@github-actions github-actions bot added the core Kafka Broker label Mar 15, 2026
Files.createFile(LogFileUtils.timeIndexFile(logDir, segmentBaseOffset).toPath());
for (MemoryRecords record : records)
segment.append(record);
segment.close();
Copy link
Member

Choose a reason for hiding this comment

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

try-finally?

assertFalse(LogTestUtils.hasOffsetOverflow(log));
}

private static class TimestampAndEpoch {
Copy link
Member

Choose a reason for hiding this comment

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

record class

for (int id = 0; id < 2; id++)
log.appendAsLeader(MemoryRecords.withRecords(Compression.NONE, new SimpleRecord(Integer.toString(id).getBytes())), 0);

byte[] magicVals = {RecordBatch.MAGIC_VALUE_V0, RecordBatch.MAGIC_VALUE_V1, RecordBatch.MAGIC_VALUE_V2};
Copy link
Member

Choose a reason for hiding this comment

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

Could you use parameterized test instead

assertEquals(7L, log.logEndOffset());

long firstOffset = 4L;
byte[] magicVals = {RecordBatch.MAGIC_VALUE_V0, RecordBatch.MAGIC_VALUE_V1, RecordBatch.MAGIC_VALUE_V2};
Copy link
Member

Choose a reason for hiding this comment

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

ditto

};

// Thread 2 watches the log and updates the high watermark
Runnable hwUpdateLoop = () -> {
Copy link
Member

Choose a reason for hiding this comment

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

        Runnable hwUpdateLoop = () -> assertDoesNotThrow(() -> {
            while (log.logEndOffset() < lastOffset) {
                log.updateHighWatermark(log.logEndOffset());
            }
        });

@github-actions github-actions bot removed the triage PRs from the community label Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Kafka Broker storage Pull requests that target the storage module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants