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

Engine abstraction remove legacy writer #10076

Merged
merged 22 commits into from
Aug 17, 2022

Conversation

pihme
Copy link
Contributor

@pihme pihme commented Aug 15, 2022

Description

  • Introduces a new task that can be scheduled by the engine and that can return records to be written
  • Replaces all references to LegacyTypedStreamWriteroutside of stream processor with scheduling of the new tasks
  • The overall result is that the engine no longer depends on any writer that writes directly to the stream. Stream processor is now in full control of when and how records shall be written (Heureka!)

Related issues

related to #9724, #9730, #9725

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/1.3) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • New content is added to the release announcement
  • If the PR changes how BPMN processes are validated (e.g. support new BPMN element) then the Camunda modeling team should be informed to adjust the BPMN linting.

Please refer to our review guidelines.

@pihme pihme requested a review from Zelldon August 15, 2022 17:56
*/
public interface TaskResult {

long writeRecordsToStream(LogStreamBatchWriter logStreamBatchWriter);

Check notice

Code scanning / CodeQL

Useless parameter

The parameter logStreamBatchWriter is unused.
@github-actions
Copy link
Contributor

github-actions bot commented Aug 15, 2022

Test Results

   847 files  ±    0     847 suites  ±0   1h 37m 29s ⏱️ - 1m 5s
6 399 tests +187  6 388 ✔️ +187  11 💤 ±0  0 ±0 
6 583 runs  +187  6 572 ✔️ +187  11 💤 ±0  0 ±0 

Results for commit 4e64c68. ± Comparison against base commit 43c17ef.

♻️ This comment has been updated with latest results.

Copy link
Member

@Zelldon Zelldon left a comment

Choose a reason for hiding this comment

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

@pihme didn't expected a PR regarding this 😁 but this a significant step forward. Awesome thank you 🏆 🤗

I had some comments, please see below before merging :)

@pihme
Copy link
Contributor Author

pihme commented Aug 16, 2022

bors merge

zeebe-bors-camunda bot added a commit that referenced this pull request Aug 16, 2022
10076: Engine abstraction remove legacy writer r=pihme a=pihme

## Description

- Introduces a new task that can be scheduled by the engine and that can return records to be written
- Replaces all references to `LegacyTypedStreamWriter`outside of stream processor with scheduling of the new tasks
- The overall result is that the engine no longer depends on any writer that writes directly to the stream. Stream processor is now in full control of when and how records shall be written (Heureka!)

## Related issues

related to #9724, #9730, #9725



Co-authored-by: pihme <pihme@users.noreply.github.com>
@zeebe-bors-camunda
Copy link
Contributor

Build failed:

@pihme
Copy link
Contributor Author

pihme commented Aug 16, 2022

bors retry

zeebe-bors-camunda bot added a commit that referenced this pull request Aug 16, 2022
10076: Engine abstraction remove legacy writer r=pihme a=pihme

## Description

- Introduces a new task that can be scheduled by the engine and that can return records to be written
- Replaces all references to `LegacyTypedStreamWriter`outside of stream processor with scheduling of the new tasks
- The overall result is that the engine no longer depends on any writer that writes directly to the stream. Stream processor is now in full control of when and how records shall be written (Heureka!)

## Related issues

related to #9724, #9730, #9725



Co-authored-by: pihme <pihme@users.noreply.github.com>
@Zelldon
Copy link
Member

Zelldon commented Aug 16, 2022

bors r-

@pihme I need to take a look at the scheduling first I think there might be some issue with the processing and scheduling work in between

@zeebe-bors-camunda
Copy link
Contributor

Canceled.

@Zelldon
Copy link
Member

Zelldon commented Aug 16, 2022

I will merge it after I have checked it :)

@Zelldon Zelldon self-assigned this Aug 17, 2022
We need to make sure that we are not concurrently executing the scheduled tasks
and the processing otherwise we might corrupt the writers, and maybe not seeing all data which have been submitted in transactions.
The dispatcher might be full and will return a negative or zero position, we need to retry writing to the dispatcher otherwise we might lose the records.
Copy link
Member

@Zelldon Zelldon left a comment

Choose a reason for hiding this comment

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

Hey @pihme

I added some more commits to your PR I hope that was OK. This allows us to make sure that the tasks are only scheduled between processing, furthermore, we retry the writing.

I added some new tests regarding the schedule service. Are you interested in reviewing the changes?

Copy link
Contributor Author

@pihme pihme left a comment

Choose a reason for hiding this comment

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

Looks good to me

/**
* @return allows to determine whether there is a current processing is on going
*/
public boolean isInProcessing() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🔧 I think this could be package/default visibility; dito for setter

@pihme
Copy link
Contributor Author

pihme commented Aug 17, 2022

@Zelldon I cannot add myself as reviewer as I am the author. Nevertheless, I did the review and approve it.

@Zelldon
Copy link
Member

Zelldon commented Aug 17, 2022

😁 thanks @pihme 🙇

The actor#run blocked the entire StreamProcessor actor, which caused major issues (in tests). We need to observe whether submit is good enough.
Copy link
Member

@Zelldon Zelldon left a comment

Choose a reason for hiding this comment

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

bors r+

@Zelldon
Copy link
Member

Zelldon commented Aug 17, 2022

bors r-

@zeebe-bors-camunda
Copy link
Contributor

Canceled.

@Zelldon
Copy link
Member

Zelldon commented Aug 17, 2022

bors r+

@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

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