Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORE-17768 Topology changes - Use new topics #4931

Merged

Conversation

mbrkic-r3
Copy link
Contributor

@mbrkic-r3 mbrkic-r3 commented Oct 18, 2023

With this change:

  • New topology Kafka topics are being used (flow.start, flow.session, flow.mapper.start, flow.mapper.session.in, flow.mapper.session.out).

  • Consumers are polled sequentially and performance impact (related to topics with low traffic) is mitigated by adjusting configuration:

    • fetch.max.wait.ms = 20
    • pollTimeout = 20ms
    • max.poll.records = 100
    • linger.ms = 50
    • batch.size = 204800
    • partition.assignment.strategy=org.apache.kafka.clients.consumer.CooperativeStickyAssignor
    • group.id=${group}-cooperative
  • Missing topic permissions are set (CORE-17768 Topology changes - Use new topics corda-api#1306)

mbrkic-r3 and others added 30 commits October 13, 2023 17:09
Adds support for state metadata to the state and event processor.

Components using the event mediator to process events and states may wish to set metadata alongside the state that is written back to the underlying state storage. This change adds to the StateAndEventProcessor API to facilitate this, as well as migrating existing state and event processors to use this.

---------

Co-authored-by: James Higgs <[email protected]>
…diator in FlowWorker (#4832)

Using Multi-Source Event Mediator instead of State and Event Subscription in FlowWorker.

Polling consumers and committing offsets performed in mediator thread in a synchronous way (without using coroutines)
Add support for parallel flows executing within the flow pipeline.

This includes:
- Temporary multi-thread implementation of the state and event pattern.
- Using the SameThreadExecutor for flow fibers, which causes the fiber to run on the thread that started the fiber.
- Using a Kryo Pool for Kryo instances, as kryo instances are not thread-safe themselves.

Add TaskManager and a TaskManagerFactory which is a wrapper around a ScheduledExecutorService used for gathering metrics on executing tasks. The built-in Micrometer metrics for executor services are used, along with some additional metrics in the TaskManager that are more specific to our use-cases.
---------

Co-authored-by: Conal Smith <[email protected]>
Co-authored-by: Dan Newton <[email protected]>
Co-authored-by: Dries Samyn <[email protected]>
…integration with StateManager (#4874)

Integration of Multi-Source Event Mediator with StateManager.
…tion

CORE-15419 5.1 Performace Integration
…e Event Mediator (#4875)

Using Multi-Source Event Mediator instead of State and Event Subscription in FlowMapperWorker.

---------

Co-authored-by: James Higgs <[email protected]>
…tion-2

CORE-15419 5.1 Performance Integration #2
… flow.mapper.start, flow.mapper.session.in, flow.mapper.session.out).
…rics-2

CORE-17562 Metrics for Multi-Source Event Mediator
…rker (#4820)

HTTP RPC server integration into the Crypto processor. Allows Crypto processor to receive HTTP external event requests sent from the flow engine. Client integration will come later.
Adds the state status key to flow mapper state metadata and populates it with the current state.

The metadata key is used by the mapper cleanup logic to ensure that mapper states are removed.
…point (#4889)

Adds session timeout to the metadata stored alongside the checkpoint.

Session timeout is implemented using the state storage lookup mechanism, which requires the metadata to be populated with the session timeout key. The earliest timestamp of session expiry for currently open sessions is the value assigned to this property.
…PC (#4885)

This PR adds a new implementation of MessagingClient, RPCClient, handling synchronous calls to the Corda workers via RPC/HTTP with configurable retries.

Includes also a small bug-fix for the task manager.

---------

Co-authored-by: Miljenko Brkic <[email protected]>
…w-topics' into mbrkic-r3/CORE-17768/topoligy-new-topics
…o mbrkic-r3/CORE-17768/topoligy-new-topics

# Conflicts:
#	components/flow/flow-service/src/main/kotlin/net/corda/flow/messaging/mediator/FlowEventMediatorFactoryImpl.kt
Omar-awad
Omar-awad previously approved these changes Oct 24, 2023
Copy link
Collaborator

@Omar-awad Omar-awad left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@Omar-awad Omar-awad left a comment

Choose a reason for hiding this comment

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

LGTM

@mbrkic-r3 mbrkic-r3 merged commit c706f7c into release/os/5.1 Oct 25, 2023
1 check passed
@mbrkic-r3 mbrkic-r3 deleted the mbrkicr3/CORE-17768/topology-changes-kafka-config branch October 25, 2023 15:50
vkolomeyko added a commit that referenced this pull request Oct 26, 2023
Omar-awad added a commit that referenced this pull request Oct 27, 2023
CORE-17768: Revert - Topology changes - Use new topics (#4931)
mbrkic-r3 added a commit that referenced this pull request Oct 27, 2023
New topology Kafka topics are being used (flow.start, flow.session, flow.mapper.start, flow.mapper.session.in, flow.mapper.session.out).

Consumers are polled sequentially and performance impact (related to topics with low traffic) is mitigated by adjusting configuration:
- fetch.max.wait.ms = 20
- pollTimeout = 20ms
- max.poll.records = 100
- linger.ms = 50
- batch.size = 204800
- partition.assignment.strategy=org.apache.kafka.clients.consumer.CooperativeStickyAssignor
- group.id=${group}-cooperative

Missing topic permissions are set (CORE-17768 Topology changes - Use new topics corda-api#1306)

---------

Co-authored-by: James Higgs <[email protected]>
Co-authored-by: Conal Smith <[email protected]>
Co-authored-by: Dan Newton <[email protected]>
Co-authored-by: Dries Samyn <[email protected]>
Co-authored-by: Omar Awad <[email protected]>
Co-authored-by: Thiago Viana <[email protected]>
Co-authored-by: David Currie <[email protected]>
Co-authored-by: James Higgs <[email protected]>
Co-authored-by: Ben Millar <[email protected]>
Omar-awad added a commit that referenced this pull request Nov 1, 2023
…-topics-omar

CORE-17768 Topology changes - Use new topics (#4931)
@mbrkic-r3 mbrkic-r3 restored the mbrkicr3/CORE-17768/topology-changes-kafka-config branch November 6, 2023 09:09
@vkolomeyko vkolomeyko deleted the mbrkicr3/CORE-17768/topology-changes-kafka-config branch June 4, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants