Repository navigation
Keep one record per server and lock the executors in the database - #15
Merged
Merged
Conversation
This was referenced Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An executor with
$serversshared one record across all its servers, so aONCEexecutor ran on only one of them, andexecute:rollbackrandown()wherever it was called. The lock relied on a cache store every server had to share, which the defaultfilestore doesn't.Changes
$serverskeeps one record per server: aONCEexecutor runs once on each listed server, and anALWAYSexecutor runs on each listed server on every deploy. Executors without$serverskeep one shared record, as before. A new migration adds theservercolumn and a uniquenameandserverindex.EXECUTOR_SERVER(pharaonic.executor.server) names the server, and$serversaccepts names next to IP addresses, so$serversworks in Docker and other containers.Executor::getServer()andExecutor::isServer()expose it.execute:rollbackandexecute:freshtake it too, and the model hides the row with a global scope.execute:rollbackonly rolls back the records this server sees, and never runsdown()for an executor limited to other servers.ONCEexecutor run twice.batch.Unreleasedsection.Compatibility
php artisan migrateafter updating. Records written before it have no server and count as run on every server, so noONCEexecutor runs again.ONCEexecutor with$serversnow runs once per listed server instead of once for the group. Leave$serversempty for work one server does for all of them.pharaonic.executor.lock.store(EXECUTOR_LOCK_STORE) is deprecated and ignored.execute:freshdeletes the records instead of truncating the table.Notes
Meant for 10.1.0. The same changes go to 11.x, 12.x, 13.x and develop afterwards.