scanner
scanner copied to clipboard
Allow multiple jobs to execute at the same time
Having the ability to execute multiple jobs enables building more reactive applications that are handling requests from users.
This would be useful soon. We're running into this situation right now where we're blocked on only running one job at a time. @apoms can you estimate complexity of changes required to do this?
I think there are only two major changes that are needed to make this possible:
- Shared database updates: Currently, the state of the database is only read into the master on startup and only written to disk when starting a job and finishing a job. This means that if another master is running at the same time, they will conflict by overwriting their respective changes to the db metadata whenever they write to it. The changes needed here is to (1) either atomically update the database metadata or lock the metadata before writing to it, and (2) check for updates and re-read the metadata from persistent storage whenever performing operations that involve reading or writing to it.
- Column locks: We need to make sure columns can not be overwritten if another job is currently producing them. This is a simple bit in the database.