History | View | Annotate | Download (20 kB)
jqueue: Add common RPC error handling function
We didn't decide yet what exactly it should do with failed nodes.
Reviewed-by: ultrotter
Make WaitForJobChanges deal with long jobs
This patch alters the WaitForJobChanges luxi-RPC call to have aconfigurable timeout, so that the call behaves nicely with long jobsthat have no update.
We do this by adding a timeout parameter in the RPC call, and returning...
jqueue: Replace normal cache dict with weakref dict
A job should only exist once in memory. After the cache is cleaned,there can still be references to a job somewhere else. If thereare multiple instances, one can get updated while a function iswaiting for changes on another instance. By using...
jqueue: Keep timestamp of opcode start and end
jqueue: Reset run_op_idx after job is done
It can be confusing otherwise.
Make sure that client programs get all messages
This is a large patch, but I can't figure out how to split it withoutbreaking stuff. The old way of getting messages by always getting thelast one didn't bring all messages to the client if they were added...
Add RPC call to wait for job changes
This way clients can react faster to status or message changes anddon't have to poll anymore.
jqueue: Change log message time format
See the comment in the patch.
jqueue: Move archived jobs on all nodes
Otherwise one might have archived jobs back in the list after a masterfailover.
Reviewed-by: iustinp
jstore: Change to not always require a lock
This way we can do locking when both noded and masterd are runningon the same machine, the latter holding an exclusive lock on thequeue.
jqueue: Use new job queue RPC functions
jqueue: Implement {Add,Remove}Node
These functions will be used to notify the queue about newly addedor removed nodes.
jqueue: Don't pass the list of nodes to SubmitJob anymore
The job queue now maintains its own list and is updated whennodes are added or removed from the cluster.
Maintain node list in job queue
The code makes sure not to include the master in the list.
jqueue: Replicate jobs to all nodes
Newly added nodes are not yet taken care of. Queue locking onnon-master nodes is not yet correct.
jqueue: Use new jstore module
jqueue: Move assert into decorator
This reduces code duplication. A later patch will modify the job queuea bit more and will need a change of this assert. The assertion isalso removed from all class-internal functions.
jqueue: Store context in job queue instead of worker pool
The job queue will need to access to configuration, which is providedthrough the context object, to get a list of nodes.
Fix pylint-detected issues
This is mostly: - whitespace fix (space at EOL in some files, not all, broken indentation, etc) - variable names overriding others (one is a real bug in there) - too-long-lines - cleanup of most unused imports (not all)...
Rewrite job queue
We found several issues in the old job queue implementation. It had raceconditions, deadlocks and other deficiencies.
Short summary:- _QueuedOpCode and _QueuedJob are now more or less data structures with a few utility functions. __Setup is gone....
jqueue: Fix error logging
The passed parameters were not correct.
Reviewed-by: iustinp, ultrotter
Implement job canceling on server side
Locking is not completeley right due to a deadlock when the job callsUpdateJob after changing its status.
Add “canceled” status for opcodes
Move code extracting job ID into function
It might come in handy at some point and makes the code a bit easierto read.
Implement job archiving on the server side
So far no error reporting to the client is done. Clients don't getnoticed if a job doesn't exist or couldn't be archived because ofits current status.
The internal cache is always cleaned when the preconditions didn't...
Add directory for archived jobs
Move code formatting job ID into a base class
A later patch will add a memory based job storage class, hence thiscode is going into a separate class. It also changes the number formatto always use at least 10 digits, allowing up to 9'999'999'999 jobs to...
Rename JobStorage to DiskJobStorage
Fix logging with string job IDs
The job ID is now a string, hence logging must use %s instead of %d.
Make job ID a string
The docstring says that _NewSerialUnlocked returns “a stringrepresenting the job identifier”. Until now it returned aninteger and this patch changes it.
Distribute the queue serial file after each update
This patch adds distribution of the queue serial file after each writeto it (but before a new job is created and written with that ID, andbefore a response is returned, so we should be safe from crashes in...
Make the job storage init reuse a serial file
This will be needed for master failover. If we don't have a valid queuedirectory, we need to reinitialize it, but we should keep the existingserial number.
As such, we abstract the reading of the serial and if we find a valid...
Make argument to CleanCacheUnlocked mandatory
Not passing the argument means it has the value None. Iterating Nonedoesn't work: >>> "123" in None Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: iterable argument required...
Implement jobs resource in RAPI
Reviewed-by: imsnah
Sort the job list in _GetJobIDsUnlocked
Since the IDs are integers, we can simply sort them.
First version of user feedback fixes
This patch contains a raw version for fixing feedback_fn.
The new mechanism works as follows: - instead of a per-Processor feedback_fn, there's one for each ExecOpCode, so that feedback for different opcodes go via possibly...
Cache some jobs in memory
This patch adds a caching mechanisms to the JobStorage. Note that isdoes not make the memory cache authoritative.
The algorithm is: - all jobs loaded from disks are entered in the cache - all new jobs are entered in the cache...
Fix JobStorage._GetJobIDsUnlocked
The job ID returned must be an integer (and the regex enforces that),but we didn't convert it manually.
Change JobStorage to work with ids not filenames
Currently some of the functions in JobStorage work with filenames (whichis an implementation detail and should only be used when dealing withthe storage) and not with job IDs. We need to change this in order to...
Add experimental persistency to job queue
It's not perfect and it's not finished, but it's a start.
- Serial number is read only once, but written on each update- Jobs are kept only on disk (caching will be implemented)
Make "gnt-job list" work again
"gnt-job list" was broken after my recent changes in the RPCbetween clients and the master. This patch makes it work again.
Switch _QueuedOpCode to have their own lock
Right now, the queued opcode doesn't have a lock, and instead relies onthe parent QueuedJob's lock.
This is not good for logging feedback, so it's better to have a lock foreach queuedopcode.
Add a simple decorator for instance methods
This is just a simple, hardcoded decorator for object methods needingsynchronization on the _lock instance attribute.
jqueue: Log more information when running opcodes
Remove old job queue code
Add very simple job queue
Fix a typo in jqueue.py
s/result/op_result/ (this code was never used, so this wasn't caught)
Add per-opcode results to job processing
This patch changes the definition of a job and introduces per-opcoderesults.
First, the result and status fields of a job are condensed into a single'status' attribute. Then, we introduce an opcode status and one result...
Implement selective job query
This patch implements query-ing of only selected jobs instead of all.
Add a simple gnt-job script
This patch adds a very basic gnt-job script that allows job querying.This goes on top of the previous master daemon patches.
Currently, because of the not-changed cmd lock, you can't query the jobsas long as a job is running - you have to rm the cmd lock and then you...
A dumb queue implementation
This patch adds a very dumb in-memory only queue implementation.