This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Ganeti core".
The branch, master has been updated
via 2117e8c1b6ffb55a9d955ca50caf1fa636cc9932 (commit)
from 6d02596fb9ea929df657cdc2d2a7f12417ca3fed (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2117e8c1b6ffb55a9d955ca50caf1fa636cc9932
Author: Niklas Hambuechen <[email protected]>
Date: Thu Sep 25 15:39:04 2014 +0200
Query.Filter: Fix `not` filters for `gnt-job list --filter`
Fixes #954.
When using a `not` filter in `gnt-job --filter`, incorrect results
were returned. Example:
$ gnt-job list
4513 canceled TEST_DELAY(1.0)
4514 canceled TEST_DELAY(1.0)
4515 success TEST_DELAY(1.0)
$ gnt-job list --filter '(status == "success")'
4515 success TEST_DELAY(1.0)
$ gnt-job list --filter 'not (status == "success")'
[no output, should be 2 lines]
The reason for this was the following sequence in
`Ganeti.Query.Query.queryJobs`:
rjids <- all relevant job IDs
-- runs first pass of the filter, without a runtime context; this
-- will limit the jobs that we'll load from disk
jids <- toError $
filterM (\jid -> evaluateQueryFilter cfg Nothing jid cfilter) rjids
-- Second pass of the filter, with runtime context (job).
fdata :: [[ResultEntry]] <- foldM
(get real data using: evaluateQueryFilter cfg (Just job) jid cfilter)
[]
jids
`jids` should be a superset of the rows of `fdata`.
The idea is that `jids` is a conservative list of candidate jobs
that we certainly have to look at.
However, the `wrapGetter` function in `evaluateQueryFilter :: ErrorResult
Bool`
unconditionally returned `True` in the first pass above, ignoring
that this `True` answer might later be negated by a `not`,
thus making `jids == []` and `fdata == []`.
This patch solves the problem by separating the answers to "does the filter"
match" and "can we not answer the query because of missing runtime data",
which were mixed up before in a single Bool; this now becomes Maybe Bool
(with `Nothing` for "can not answer").
Signed-off-by: Niklas Hambuechen <[email protected]>
Signed-off-by: Klaus Aehlig <[email protected]>
Reviewed-by: Klaus Aehlig <[email protected]>
-----------------------------------------------------------------------
Summary of changes:
src/Ganeti/Query/Filter.hs | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
hooks/post-receive
--
Ganeti core
--
---
You received this message because you are subscribed to the Google Groups
"ganeti-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.