Prepare NEWS file for 2.12.0~rc1

Mention inherited changes as well as the fixes made to
stable-2.12 since rc1.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Suffix bump for 2.12.0~rc2

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Make watcher identify itself on disk verification

The watcher also submits GroupVerifyDisks jobs. Make it add
a corresponding reason trail entry.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Pepare NEWS entry for a 2.11 point release

The main news is the relicensing under the 2-clause BSD
license.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Bump revision bump 2.11.6

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  Bump revision bump 2.11.6
  Pepare NEWS entry for a 2.11 point release

Conflicts:
	NEWS: take all the entries
	configure.ac: ignore revision bump

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Merge branch 'stable-2.12' into master

* stable-2.11
  Bump revision bump 2.11.6
  Pepare NEWS entry for a 2.11 point release

* stable-2.12
  Make watcher identify itself on disk verification
  Suffix bump for 2.12.0~rc2
  Prepare NEWS file for 2.12.0~rc1

Conflicts:
	configure.ac: ignore suffix bump

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
design-optables: Use double quotes in examples

This makes copy-pasting them into `gnt-filter`/curl easier since
JSON requires double quotes.

Admittedly, these were originally thought of as Python dicts so
the single quotes were fine, but in practice these examples are used
more often where JSON is required.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Add missing ecode

When raising an OpPrereqError, an error code always has to be provided,
even if we raise the exception indirectly via result.Raise.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add missing ecode

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add missing ecode

When rising OpPrereqError, the arguments always have to be
a human-readable string and an error code. Provide that.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add missing error code

OpPrereqError always takes a human-readable string and an
error code as argument. Fix it. Unfortunately, we do not
have a type checker to enforce this.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add missing error code

While there, also fix a typo

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add missing error codes

...they are mandatory for OpPrereqError exceptions.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Explicitly log failed opportunistic locking

Add an additional log entry if the IAllocator failed to find
a solution in opportunistic locking. Otherwise the IAllocator
message would get lost on internal retries.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Extend the callback interface by NotifyRetry

Given that we will support internal retries after failed opportunistic
locking, also extend the callback interface accordingly.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Reset op status to wating on NotifyRetry

When a job is retried, it is effectively reset, so we have to
reset the state back to waiting again. This will also ensure
that we're not unpleasantly surprised when NotifyStart is called
the second time.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add new GenericErrror OpRetryNotSupportedError

LUs that temporarily run out of resources, most notably
instance creation with opportunistic locking, may opt
into retrying. If they don't do so, this is the exception
to be thrown on a retry-preparation attempt. Having a
custom exception rather than throwing NotImplementedError
pleases lint.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Extend base LU by PrepareRetry

LUs may override this method if they know how to prepare for an internal
retry after temporarily being out of resources.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Make mcpu handle retry requests internally

If the execution of a logical unit indicates that it is
temporarily out of resource (ECODE_TEMP_NORES), then make
the mcpu prepare the the logical unit for retry and restart
again.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>