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

Fix for #278 Bug: Variables and ElementInstances not stored in DB #280

Conversation

nitram509
Copy link
Collaborator

The root cause was a broken check for duplicates in the DB.
This solution favors creating new ID unique index fields for the two mentioned tables,
in order to feed all data (variables and element_instances) into the DB.
Assuming, there are no duplicate events exported, there's no need for a duplicate check.

Additionally, two indices are added, for performance reasons.

Unfortunately, because JPA requires an @id field, a new field was introduced
and there's an UPGRADE instruction documented, so people out there would be able to migrate their installations.
In other words, this PR contains a breaking change in DB structures.

Also, if you look at what files are changed, this PR contains two commits.
The first one is pure refactoring, in order to split the ZeebeImportService class into multiple importer-classes.
This is mainly for readability. I hope you find this useful.
The second commit is the bug fix itself.

Any feedback is welcome.

… not stored in DB

The root cause was a broken check for duplicates in the DB.
This solution favors creating new ID unique index fields for the two mentioned tables,
in order to feed all data (variables and element_instances) into the DB.
Assuming, there are no duplicate events exported, there's no need for a duplicate check.
Additionally, two indicies are added, for performance reasons.
Unfortunately, because of JPA requires an @id field, a new field was introduced
and there's a UPGRADE instruction documented, so people out there would be able to migrate their installations.
@saig0
Copy link
Contributor

saig0 commented Aug 6, 2021

@nitram509 thank you for your contribution 🎉

Please have a look at my comment: #278 (comment)

Other comments to the PR,

  • splitting into different classes is okay for me
  • adding the indexes is a good idea but I would prefer a separate PR
  • I appreciate the update guide 👍

@nitram509
Copy link
Collaborator Author

I will close this PR and create separate ones, as recommended.

@nitram509 nitram509 closed this Aug 9, 2021
@nitram509
Copy link
Collaborator Author

See #284 for part 1, the refactoring.

@nitram509 nitram509 deleted the fix-synchronization-issue branch August 9, 2021 06:38
nitram509 added a commit to nitram509/zeebe-simple-monitor that referenced this pull request Aug 9, 2021
This solution favors creating new ID, based on a composition of partitionId and position.
See comments in PR camunda-community-hub#280 and Issue camunda-community-hub#278 for more details.
Tests are added to show implementation works properly
Unfortunately, because of JPA requires an @id field, a new field was introduced
and there's an UPGRADE instruction documented, so people out there would be able to migrate their installations.
nitram509 added a commit to nitram509/zeebe-simple-monitor that referenced this pull request Aug 9, 2021
This solution favors creating new ID, based on a composition of partitionId and position.
See comments in PR camunda-community-hub#280 and Issue camunda-community-hub#278 for more details.
Tests are added to show implementation works properly
Unfortunately, because of JPA requires an @id field, a new field was introduced
and there's an UPGRADE instruction documented, so people out there would be able to migrate their installations.
nitram509 added a commit to nitram509/zeebe-simple-monitor that referenced this pull request Aug 27, 2021
This solution favors creating new ID, based on a composition of partitionId and position.
See comments in PR camunda-community-hub#280 and Issue camunda-community-hub#278 for more details.
Tests are added to show implementation works properly
Unfortunately, because of JPA requires an @id field, a new field was introduced
and there's an UPGRADE instruction documented, so people out there would be able to migrate their installations.
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.

2 participants