poolmanager,pool: Fix precision underflow in WASS

Fixes a problem in which a large number of writers on a pool (such as what you
would see on a tape read pool) would cause the scale of a double to underflow,
causing the weigthed acailable space to become zero.  If all pools have such
high load, no pool would be availble for selection and pool manager would
report that no pool is available for staging.

The fix uses the fact that only the relative weighted available space is
relevant. Since the weighted space is calculated by dividing unweighted space
with two to the power of the load, we can subtract a constant from the load of
all pools and maintain the relative available space of each pool. The patch
first finds the lowest load of all non-full pools in the selection and
subtracts that from the load of all pools, thus normalizing the calculation.

Other pools may have even high load, still causing the precision of a double to
be insufficient, however the likelihood of selection such a pool is virtuallt
zero anyway, so this barely affects the write distribution. The normalization
does however ensure that at least one pool does not underflow (assuming
non-full pools exist at all) and thus that a pool can be selected.

Target: trunk
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Acked-by: Dmitry Litvtinsev <litvinse@fnal.gov>
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Ticket: http://rt.dcache.org/Ticket/Display.html?id=7993
(cherry picked from commit 80ade65b1a6399b443512fc5c12f929c276eb630)
Merge pull request #499 from gbehrmann/fix/2.7/rb6914

poolmanager,pool: Fix precision underflow in WASS
[maven-release-plugin] prepare release 2.7.10
[maven-release-plugin] prepare for next development iteration
nfs: do not use CDC as try-with-resource

in a cunstruction like:

  try (CDC ignored = new CDC()) {
     ....
  } catch (Exception e) {
    log.error(e);
  }

the catch block will not have a correct context.
Use try-catch-finally instead.

Acked-by: Gerd Behrmann
Target: master, 2.9, 2.8, 2.7
Require-book: no
Require-notes: no
(cherry picked from commit c34be640f9aaa59a93048fd5ef16ef7af652c8ca)
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
(cherry picked from commit c4fef0c2ff2b50f3e7106859411d09c47d5e98f3)
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Merge pull request #504 from kofemann/fix-cdc-proxy-2.7

nfs: do not use CDC as try-with-resource
poolmanager: Fix infinite loop in lru partition type

Target: trunk
Require-notes: yes
Require-book: no
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6938/
(cherry picked from commit 6750fd426d7e60da7332453a28bfbc88d228274e)
pool: Report correct client IP to billing for passive FTP transfers

The pool incorrectly reported the FTP proxy address of the FTP door
even when a direct connection between the client and the pool was
established.

Target: trunk
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Require-notes: yes
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6940/
(cherry picked from commit 7e6e2ef7a8ad506293fc440cc1354eeed9c2607a)
Merge pull request #514 from gbehrmann/fix/2.7/rb6940

pool: Report correct client IP to billing for passive FTP transfers
Merge pull request #509 from gbehrmann/fix/2.7/rb6938

poolmanager: Fix infinite loop in lru partition type
statistics: Fix NPE

Fixes

java.lang.NullPointerException: null
        at diskCacheV111.services.PoolStatisticsV0.printTotal(PoolStatisticsV0.java:1219) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at diskCacheV111.services.PoolStatisticsV0.prepareDailyHtml(PoolStatisticsV0.java:1151) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at diskCacheV111.services.PoolStatisticsV0.prepareDailyHtmlFiles(PoolStatisticsV0.java:1056) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at diskCacheV111.services.PoolStatisticsV0.access$1100(PoolStatisticsV0.java:119) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at diskCacheV111.services.PoolStatisticsV0$HourlyRunner.run(PoolStatisticsV0.java:441) ~[dcache-core-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at dmg.cells.nucleus.CellNucleus$3.run(CellNucleus.java:707) [cells-2.10.0-SNAPSHOT.jar:2.10.0-SNAPSHOT]
        at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]

If there is no data, we cannot print a total.

Target: trunk
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6963/
(cherry picked from commit 01941732a40f7be8abfbaf4cb5c9bc4cba96fc0e)
dcache alarms: add missing configuration elements and documentation for SMTP appender

This is a minimal backport of http://rb.dcache.org/r/6949.

Instead of adding support for exposing the entire configuration
of the SMTP appender through the dcache property framework,
we have simply added the missing elements, plus explanatory
comments, to the logback-server.xml.

Target: 2.7
Request: 2.9
Request: 2.8
Request: 2.6
Patch: http://rb.dcache.org/r/6957
Acked-by: Paul
Merge pull request #523 from gbehrmann/fix/2.7/rb6963

Fix/2.7/rb6963
Merge pull request #527 from alrossi/fix/2.7/alarms-email-configuration

Fix/2.7/alarms email configuration
[maven-release-plugin] prepare release 2.7.11
[maven-release-plugin] prepare for next development iteration
fhs: Use gzip compression for deb package

Ubuntu 14.04 defaults to xv which isn't supported by Ubuntu 10.10.
To restore compatibility, this patch explicitly sets the compression
format to gzip.

Target: trunk
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Require-notes: no
Require-book: no
(cherry picked from commit 4b7d7a057f9fbbea32eeffb8caa741e62235c992)
Merge pull request #531 from gbehrmann/fix/2.7/rb6964

Fix/2.7/rb6964
gplazma2-ldap: use url rather than host+port

the ldap plugin builds the url of the ldap server using

"ldap://" + host + ":" + port

this way the protocol always is always "ldap". This prevents
the plugin from using secure ldap using "ldaps".
This patch substitutes host and port by a freely definable url.

Ticket: 8289
Acked-by:
Target: 2.7
Require-book: yes
Require-notes: yes
remove deprecated annotations for back-port