-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
11631: fix: disable batch processing by default on 8.1 r=oleschoenburg a=oleschoenburg Updates config templates and default config to disable batch processing by default relates to #11539 11649: deps(maven): bump netty-bom from 4.1.88.Final to 4.1.89.Final r=oleschoenburg a=dependabot[bot] Bumps [netty-bom](https://github.com/netty/netty) from 4.1.88.Final to 4.1.89.Final. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/netty/netty/commit/263a745b93513b8f761daa007897af9ce57161ba"><code>263a745</code></a> [maven-release-plugin] prepare release netty-4.1.89.Final</li> <li><a href="https://github.com/netty/netty/commit/ed425fe281f7f20a9d946d9f8213be0a64f3a778"><code>ed425fe</code></a> Don't fail on HttpObjectDecoder's maxHeaderSize greater then (Integer.MAX_VAL...</li> <li><a href="https://github.com/netty/netty/commit/a803e107614bc8aa0886b9b7ae742463c6a156c1"><code>a803e10</code></a> Revert "Revert "Speed-up HTTP 1.1 header and line parsing (<a href="https://github-redirect.dependabot.com/netty/netty/issues/12321">#12321</a>)""</li> <li><a href="https://github.com/netty/netty/commit/9993e07356ea39edf14008789d3377d2bb62ea92"><code>9993e07</code></a> Revert "Speed-up HTTP 1.1 header and line parsing (<a href="https://github-redirect.dependabot.com/netty/netty/issues/12321">#12321</a>)"</li> <li><a href="https://github.com/netty/netty/commit/4475b5c5719e7e7f36f2f01e25c139bcb2b048d4"><code>4475b5c</code></a> [maven-release-plugin] prepare for next development iteration</li> <li>See full diff in <a href="https://github.com/netty/netty/compare/netty-4.1.88.Final...netty-4.1.89.Final">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=io.netty:netty-bom&package-manager=maven&previous-version=4.1.88.Final&new-version=4.1.89.Final)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - ``@dependabot` rebase` will rebase this PR - ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it - ``@dependabot` merge` will merge this PR after your CI passes on it - ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it - ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging - ``@dependabot` reopen` will reopen this PR if it is closed - ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com> Co-authored-by: Christopher Zell <zelldon91@googlemail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
Showing
11 changed files
with
146 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
...ne/src/test/java/io/camunda/zeebe/streamprocessor/StreamProcessorBatchProcessingTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.1. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.1. | ||
*/ | ||
package io.camunda.zeebe.streamprocessor; | ||
|
||
import static io.camunda.zeebe.engine.util.RecordToWrite.command; | ||
import static io.camunda.zeebe.protocol.record.intent.ProcessInstanceIntent.ACTIVATE_ELEMENT; | ||
import static org.assertj.core.api.AssertionsForClassTypes.assertThat; | ||
import static org.awaitility.Awaitility.await; | ||
import static org.mockito.ArgumentMatchers.any; | ||
import static org.mockito.Mockito.timeout; | ||
import static org.mockito.Mockito.verify; | ||
import static org.mockito.Mockito.when; | ||
|
||
import io.camunda.zeebe.engine.api.ProcessingResultBuilder; | ||
import io.camunda.zeebe.engine.util.Records; | ||
import io.camunda.zeebe.engine.util.StreamPlatform; | ||
import io.camunda.zeebe.engine.util.StreamPlatformExtension; | ||
import io.camunda.zeebe.protocol.impl.record.value.processinstance.ProcessInstanceRecord; | ||
import io.camunda.zeebe.protocol.record.RecordType; | ||
import io.camunda.zeebe.protocol.record.RejectionType; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.ArgumentCaptor; | ||
import org.mockito.verification.VerificationWithTimeout; | ||
|
||
@ExtendWith(StreamPlatformExtension.class) | ||
public class StreamProcessorBatchProcessingTest { | ||
|
||
private static final long TIMEOUT_MILLIS = 2_000L; | ||
private static final VerificationWithTimeout TIMEOUT = timeout(TIMEOUT_MILLIS); | ||
|
||
private static final ProcessInstanceRecord RECORD = Records.processInstance(1); | ||
|
||
@SuppressWarnings("unused") // injected by the extension | ||
private StreamPlatform streamPlatform; | ||
|
||
@Test | ||
public void shouldProcessFollowUpEventsAndCommands() { | ||
// given | ||
streamPlatform.setMaxCommandsInBatch(100); // enable batch processing | ||
final var defaultRecordProcessor = streamPlatform.getDefaultMockedRecordProcessor(); | ||
final var resultBuilderCaptor = ArgumentCaptor.forClass(ProcessingResultBuilder.class); | ||
when(defaultRecordProcessor.process(any(), resultBuilderCaptor.capture())) | ||
.thenAnswer( | ||
(invocation) -> { | ||
final var resultBuilder = resultBuilderCaptor.getValue(); | ||
resultBuilder.appendRecordReturnEither( | ||
1, | ||
RecordType.EVENT, | ||
ACTIVATE_ELEMENT, | ||
RejectionType.NULL_VAL, | ||
"", | ||
Records.processInstance(1)); | ||
resultBuilder.appendRecordReturnEither( | ||
2, | ||
RecordType.COMMAND, | ||
ACTIVATE_ELEMENT, | ||
RejectionType.NULL_VAL, | ||
"", | ||
Records.processInstance(1)); | ||
return resultBuilder.build(); | ||
}) | ||
.thenAnswer( | ||
(invocation) -> { | ||
final var resultBuilder = resultBuilderCaptor.getValue(); | ||
resultBuilder.appendRecordReturnEither( | ||
3, | ||
RecordType.EVENT, | ||
ACTIVATE_ELEMENT, | ||
RejectionType.NULL_VAL, | ||
"", | ||
Records.processInstance(1)); | ||
return resultBuilder.build(); | ||
}); | ||
|
||
streamPlatform.startStreamProcessor(); | ||
|
||
// when | ||
streamPlatform.writeBatch(command().processInstance(ACTIVATE_ELEMENT, RECORD)); | ||
|
||
// then | ||
verify(defaultRecordProcessor, TIMEOUT.times(2)).process(any(), any()); | ||
await("Last written position should be updated") | ||
.untilAsserted( | ||
() -> assertThat(streamPlatform.getLogStream().getLastWrittenPosition()).isEqualTo(4)); | ||
await("Last processed position should be updated") | ||
.untilAsserted( | ||
() -> | ||
assertThat( | ||
streamPlatform.getStreamProcessor().getLastProcessedPositionAsync().join()) | ||
.isEqualTo(1)); | ||
|
||
final var logStreamReader = streamPlatform.getLogStream().newLogStreamReader(); | ||
logStreamReader.seekToFirstEvent(); | ||
final var firstRecord = logStreamReader.next(); | ||
assertThat(firstRecord.getSourceEventPosition()).isEqualTo(-1); | ||
final var firstRecordPosition = firstRecord.getPosition(); | ||
|
||
await("should write follow up events") | ||
.untilAsserted(() -> assertThat(logStreamReader.hasNext()).isTrue()); | ||
while (logStreamReader.hasNext()) { | ||
assertThat(logStreamReader.next().getSourceEventPosition()).isEqualTo(firstRecordPosition); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters