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

Dx create ep info updated messages #55

Open
wants to merge 11 commits into
base: dx-topic-replay
Choose a base branch
from

Conversation

yugen
Copy link
Collaborator

@yugen yugen commented Mar 7, 2024

Add actions to generate missing ep_info_updated dx messages and reorder/reindex stream message by created_at.

I opted to run these operations as two separate migrations so that one can fail (though that's not expected) without effecting the other.

@yugen yugen requested a review from bpow March 7, 2024 13:17

public function handle()
{
$this->backupStreamMessages();
Copy link
Collaborator

Choose a reason for hiding this comment

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

To be as paranoid as possible, should probably have try/catch around backing up of messages-- if this fails we wouldn't be able to restore, so shouldn't go any further.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It occurred to me that if line 17 errors out, the following lines will not run, but in the spirit of your paranoia, I've added a check that the backup table has the same number of records as the original and throws an exception if they're not equal.

I've also wrapped the backup and check in a try/catch block to explicitly handle the case that the backup fails.

@yugen yugen force-pushed the dx-create-ep-info-updated-messages branch from e404657 to 1cd3657 Compare March 17, 2024 14:25
@bpow bpow force-pushed the dx-topic-replay branch 2 times, most recently from 598fc13 to b6fecf0 Compare April 8, 2024 00:17
@bpow bpow force-pushed the dx-create-ep-info-updated-messages branch from 1cd3657 to a49e84e Compare April 8, 2024 00:36
@bpow bpow force-pushed the dx-create-ep-info-updated-messages branch from a49e84e to 8e08951 Compare April 16, 2024 14:32
public function handle()
{
// Delete errant member_retired for Aurora Pujol on group Peroxisomal Disorders VCEP
StreamMessage::find(4034)->delete();
Copy link
Collaborator

Choose a reason for hiding this comment

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

We will have to have a better way of identifying these records for deletion beside the id... because of the prior migration/reindexing, these messages will have moved to a different id (at least they appear to have done so in my test environment). Maybe they could at least be identified by timestamp?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What if we run this in a migration before reindexing? In fact, we could run it before we do anything else to be sure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Lookup for these messages is now based on attributes of the message rather than the id.

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