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
check both stores for an action while migration is in progress #489
Conversation
@thenbrent Could you give this one a sanity check where I added |
This is a bit of a dangerous change, but it looks good @rrennick. I like the introduction of a central The reason I says it's a dangerous changes is because prior to this patch, if an action had an Processing actions under new conditions creates the risk of processing an action when it shouldn't be run. I can't see any conditions where this would cause a problem. Even when considering corner-cases like upgrade-downgrade-upgrade. However, I want to mention the risk as it should be considered before merging. |
I'm unqualified to talk about the risk but I followed the instructions and I'm pretty sure it tested ok. |
@thenbrent Thanks, good point. @becdetat Thanks for the feedback :) |
@jeffstieler This is ready for a review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tested well with the provided instructions, but there seems to be some copy-pasta in the get_store_from_action_id()
logic.
AS only uses the hybrid store fetch_action in the queue runners and the list table. The hybrid store claims actions for the queue runners from the primary store. The flag ensures that the queue runner receives actions from the primary store in the event of a duplicate action ID. If there is a duplicate action ID between stores, the secondary store one will be inaccessible in the list table until it is migrated.
@jeffstieler This is ready for another review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good and (still) tests well.
Closes #486
This PR updates the Hybrid data store to use the primary & secondary data stores'
fetch_action
to determine whether an action ID exists in that store before using the store to retrieve action data. Both data stores implement exception handling infetch_action
and return a NullAction action when the action is not found/valid.SELECT MIN(action_id) FROM wp_actionscheduler_actions;
action_id
in the actions tablewp option update action_scheduler_hybrid_store_demarkation 123456
wp option delete action_scheduler_migration_status
Pending
/Completed
list for the test actions to be processed