Move aside old heap dumps prior to daemon startup

The JVM can't successfully write out a heap snapshot if a file already
exists at the target location (which is stupid, but them's the breaks).
This commit adds logic to our init scripts to move any pre-existing heap
snapshot out of the way prior to starting the daemon. This means that we
retain one previous heap snapshot, but that should help during
situations where an OutOfMemoryError prompted an immediate service
restart (to restore operations), but we'd still like a heap dump for
forensic analysis.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #268 from grimradical/bug/master/15645-remove-prev-heapdump

Move aside old heap dumps prior to daemon startup
(#15645) Daemon should terminate upon OOM error

Though we can potentially catch an OOM error and do something about it,
it’s not guaranteed that the error will occur in a thread in which we
can interpose our own logic. But certainly we shouldn’t keep the process
going if an OOM renders it effectively inoperative...better to just kill
the process altogether than to leave a zombie around.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #269 from grimradical/bug/master/15645-die-on-oom

(#15645) Daemon should terminate upon OOM error
Use the correct operator for tag array comparison

This was previously using an incorrect operator. Using the correct
operator seems better.
Merge pull request #270 from nicklewis/add-missing-indexes

Add missing indexes on catalog_resources
Correctly log slow queries when no statement is available
Don't create GIN index on tags for old Postgres versions

These aren't supported before Postgres 8.2, so we now have an explicit
check before adding them.
Add a warning message about old version of Postgres
Add a notification that the indexes migration may be slow
Merge branch 'no-gin-indexes-on-old-postgres'
Don't thread where a function call will suffice

The -> & ->> threading macros are very useful to sometimes untangle
nested function calls. However, as it's just a single function call on a
Clojure map, directly call the function with our data to simplify things
for the reader.
Using the string/join function for non-lazy evaluation

The use of interpose is useful if we're expecting to produce a lazy seq
seperated by our delimeter. In this case, we were taking this lazy
sequence and converting it into a string (non lazy) anyway.

Rather than add this implicit complexity, use clojure.string/join to do
the interposing of the delimeter using a StringBuilder recursing over
the sequence we provide it.
Merge pull request #271 from KushalP/master

Simple refactoring of two function calls
Support tag queries on Postgres 8.1

This version doesn't have the <@ operator for arrays, so we have to fall
back to using ANY.
Don't track the target directory

Sometimes we might build artefacts that end up in the target directory.
Don't bother tracking these as they are artefacts of the build process.
Remove use of threading operator to simplify function calls

There are cases where the threading operator has been used, but the raw
function calls end up being more readable.

Strip out this extra syntactic sugar and go with the raw functions and
data.
Add a reference to the Trello board to CONTRIBUTING.md
Merge branch 'no-gin-indexes-on-old-postgres'
Merge branch 'update-contributing'