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

[Backport stable/1.3] Do not open dispatcher on follower role #9377

Merged
merged 9 commits into from
May 16, 2022

Conversation

deepthidevaki
Copy link
Contributor

Description

Backport of #9367

related #8509

In follower role, StreamProcessor is running only in replay mode. When the writer is created, dispatcher is also opened which allocates direct buffer. This is unnecessary as the writer is never used. The allocated buffer consumes memory and can create memory pressure on the system. To fix this, we create the writer only after the replay is completed.

(cherry picked from commit c14e56f)
This is needed for testing where we want to mock the writer.

(cherry picked from commit c005c6c)
After the fix where the creation of the writer is moved after the replay is completed, this test failed because the mock writer created by the test is overwritten by the StreamProcessor. To prevent this, we added a new streamWriter factor that can be used by the test to inject mock writers.

(cherry picked from commit d85da02)
@deepthidevaki
Copy link
Contributor Author

bors merge

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit 9b8dcfd into stable/1.3 May 16, 2022
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the backport-9367-to-stable/1.3 branch May 16, 2022 07:01
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.

None yet

2 participants