Statistics
| Branch: | Tag: | Revision:

root / src / Ganeti / JQueue.hs @ d8216f2d

History | View | Annotate | Download (21.3 kB)

# Date Author Comment
a2dbdd82 02/06/2014 02:16 pm Klaus Aehlig

Merge branch 'stable-2.11' into master

  • stable-2.11
    Implement ChangeJobPriority in luxid
    Provide a function to change the priority of a queued job
    When enqueuing new jobs, respect job ID
    Change return type of internal rmJob
    Add a function to change the priority of a job...
a7ab381a 02/06/2014 12:43 pm Klaus Aehlig

Add a function changing the priority of an opcode

This pure function follows the semantic that an opcode, including
its priority, may only be changed if the opcode is not finalized.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

a6b33b72 02/06/2014 12:43 pm Klaus Aehlig

Add a function to change the priority of a job

...by changing the priority of the non-finished opcodes.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

ea7032da 01/30/2014 04:10 pm Petr Pudlak

Update getDirJobIDs to use ResultT

Also simplify code and remove unused functions.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

0c09ecc2 01/29/2014 03:12 pm Klaus Aehlig

Make safeRenameFile create dirs with defined permissions

If, and only if, safeRenameFile creates a new directory, make sure
it has well defined permissions. While there, also optimize for the
common case. The main use of safeRenameFile is archiving jobs. As...

f23daea8 01/29/2014 03:12 pm Klaus Aehlig

Add constant for subdir permissions within the job queue

When archiving jobs, new directories have to be created, as
jobs are archived in groups of 10000. Add a constant describing
the permissions of these newly created directories.

Note that, due to the type, the constant cannot be part...

c867cfe1 01/24/2014 02:38 pm Klaus Aehlig

Add a utility function to try archiving jobs

Provide a function that walks through a list of job ids and
archives them if appropriate. Abort that process if a given
timeout is reached.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

8b5a4b9a 01/24/2014 02:38 pm Klaus Aehlig

Support computation on Timestamp

As timestamps are also used to determine if an event is sufficiently
long in the past (e.g., on archiving jobs), support adding a time
interval to a Timestamp.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

ae66f3a9 01/24/2014 02:38 pm Klaus Aehlig

Add constructor function for Timestamp

Provide means to get Ganeti's internal timestamps
from standard clock time.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

370f63be 01/24/2014 02:38 pm Klaus Aehlig

Add a predicate on Jobs on whether it can be archived

Jobs usually are archived a given time after they have finished.
For finalized jobs without end-time, the start-time is taken en
lieu. This function provides the pure predicate for this decision.

Signed-off-by: Klaus Aehlig <>...

77676415 01/20/2014 11:50 am Klaus Aehlig

When updating job queue, support virtual paths

When replicating parts of the job queue, allow for virtual
paths in the RPC call. In this way, replication will also
work correctly in a vcluster setup. Note that makeVirtualPath
lives in IO, and hence cannot be part of the pure encoding...

363dc9d6 01/15/2014 02:34 pm Klaus Aehlig

Provide a function to compute the canceled version of a job

When a job gets canceled while still queued, dequeuing requires
luxid to mark it as cancelled. So provide the necessary pure
function to do so.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

47c3c7b1 01/15/2014 02:34 pm Klaus Aehlig

Support canceling dequeued jobs

Even after jobs have been handed over for execution, it might
still be possible to cancel them. On such case would be the
job still waiting for a lock. Eventually, we will have to
communicate to the job directly, but as long as execution is...

557f5dad 12/13/2013 11:57 am Klaus Aehlig

Generate a separate return type for the job queue update RPC

The instantiation of RPC requires a bidirectional functional dependency
between call type and return type. Hence we cannot use Unit everywhere.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

d605e261 12/11/2013 12:07 pm Petr Pudlak

Rename getClient/Server to getLuxiClient/Server

Later they will be split into LUXI-specific and general parts.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

02e40b13 12/04/2013 05:52 pm Klaus Aehlig

Add a predicate to determine if a job has been started

Add a predicate jobs indicated that it has left the queue. This
will be needed, to allow restarts of luxid (which now handles
the queue) independent of jobs (currently running in masterd).

Signed-off-by: Klaus Aehlig <>...

847df9e9 12/04/2013 05:52 pm Klaus Aehlig

Provide a function to determine whether a job is finalized

While there is a function to calculate the job status, sometimes
it is only relevant if the job is finalized. In this case, it is
more readable not having to know the internal order of JobStatus....

ac0c5c6d 12/02/2013 04:08 pm Klaus Aehlig

Rename enqueueJobs to startJobs

This reflects better what the method actually does. Later,
we will add a job scheduler that will provide a proper enqueue
method.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

2af22d70 11/28/2013 04:59 pm Klaus Aehlig

Provide a function to set the received times tamp of a job

This is the pure function for changing the received time stamp;
obtaining the actual time stamp has to be done in IO.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Helga Velroyen <>

c3a70209 11/28/2013 04:59 pm Klaus Aehlig

Document the jobqueue timestamp format

...and also provide a method to get the current time in
that format.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Helga Velroyen <>

493d6920 11/26/2013 03:31 pm Klaus Aehlig

Add function to enqueue jobs

Add a function that ensures that a given set of jobs gets executed at
the appropriate time. At the moment, this is still the simple
mechanism of handing over everything to masterd; but even at this
stage, it has the benefit of allowing to remove code duplication in...

9fd653a4 11/26/2013 03:31 pm Klaus Aehlig

Add wrapper to replicate many jobs

Add a convenience wrapper around replicateJob to replicate
many jobs to the master candidates.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

b5a96995 11/26/2013 03:31 pm Klaus Aehlig

Add function to replicate a job to the master candidates

As luxid will be handling the job queue soon, add a utility to
replicate jobs to all master candidates. Also log errors.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

f7819050 11/26/2013 03:31 pm Klaus Aehlig

Release internal lock for serial file later

When allocating new jobs, the new serial is replicated among
all master candidates. To avoid races with a later job id
allocation, keep the internal lock till after the replication
attempt.

Signed-off-by: Klaus Aehlig <>...

1b94c0db 11/08/2013 07:00 pm Klaus Aehlig

Add the predicate of the queue being open

Adding jobs to the queue is only allowed if the queue
is not drained.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Michele Tartara <>

b498ed42 11/08/2013 07:00 pm Klaus Aehlig

Provide a function to write jobs to disk

This function writes a (non-archived) job to disk. The file
name can be computed from the job id, which is part of the job.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Michele Tartara <>

ae858516 11/08/2013 07:00 pm Klaus Aehlig

Provide means to allocate new job ids

Add utility functions to allocate new job ids by increasing
the value stored in the serial file. As this function is
used in a multi-threaded program, synchronize access over
an internal lock.

Signed-off-by: Klaus Aehlig <>...

cef3f99f 11/08/2013 07:00 pm Klaus Aehlig

Provide method to read job serial number

This methods allows reading the maximal job serial number from
disk.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Michele Tartara <>

1c1132f4 11/08/2013 07:00 pm Klaus Aehlig

Provide convenience function to create Job from op-codes

This function handles the pure part of generating a job,
i.e., assuming the job id already assigned and not setting
time stamps.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Michele Tartara <>

4b49a72b 11/08/2013 06:59 pm Klaus Aehlig

Provide a convenience method to optain a QueuedOpCode

When generating jobs from sequences of op-codes, it is necessary
to wrap op-codes into queued form.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Michele Tartara <>

3cecd73c 04/08/2013 12:25 pm Michele Tartara

Backwards compatibility fix for Lucid

The code introduced by the previous commit triggered a possible library
conflict in Ubuntu Lucid.

This patch introduces an equivalent but more widely acceptable version of
the same code.

Signed-off-by: Michele Tartara <>...

be0cb2d7 04/08/2013 10:50 am Michele Tartara

Properly export errors while reading job list

In case of problems while reading the job list from disk (such as permission
errors) confd would silently fail, writing a warning on the log file but
sending an empty list and no error message to the client.
...

3add7574 12/24/2012 11:38 pm Iustin Pop

Rename htools/ to src/

Per offline discussions, this is the first patch of the
renames. Tested with "make distcheck", seems to work fine.

The only change outside of the renaming is a bit of simplification in
the .gitignore rules; otherwise, simply s/htools/src/....