Introduce pooling of KernelTransactions.
Slave goes through 'switchToSlave' process on every 'masterIsElected' event
CappedOperation does not trigger on first time event

Previously, a CappedOperation was triggered the first event regardless of
which triggered were specified. This was unexpected and counter intuitive,
especially for cases (where it is most used) where a CappedOperation was
added as a time-based logger and a log statement was expected to be
printed after the specified threshold, it would log immediately as well.
Removes console output from GraphDatabaseServiceTest
Fixes XaLogicalLog shutdown issue

XaLogicalLog.close() was flushing the store files after
 marking the active log file as applied. This could
 lead to recovery not happening if shutdown
 failed within a narrow window between log
 shutdown and store flush. This is now fixed.
The LogBackedXaDatasource defined a stop() method that
 managed log lifecycle without having to. This is now
 removed and log lifecycle control is delegated to
 subclasses through XaContainer.
Single thread pulling updates on HA machines

Moving from an HA communication design where updates gets streamed from
the master on most individual requests coming from slaves. This design
caused lots of duplicate transactions being streamed from master to each
slave, specifically if slaves issued write requests to the master.

Moving to a design where slave communication with its master does not
stream back transactions, except when doing store copy. Instead master
returns a transaction obligation saying which transaction id that must be
applied in order to continue. The slave will notify the single update
puller about that and will in turn be notified by the update puller
when that transaction has been applied. Many requests can poke the update
puller simultaneously and transaction pulling will piggy back on each
other, since there's only one thread pulling.

Benefits include:
- No code explicitly dealing with and preventing pull storms
- Less network communication with master
- Less load put on master
- Possibility for more optimizations regarding applying updates on slaves
  since updates are pulled in a single thread only.
Removed unnecessary TxIdGenerator abstraction
Merge pull request #3229 from digitalstain/1.9-fix-llog-shutdown

[1.9] fix logical log shutdown
Merge pull request #3227 from tinwelint/1.9-capped-ops-no-first

[1.9] CappedOperation does not trigger on first time event
Slaves applies transactions from master in batches

by having a specific TransactionAppender that doesn't do auto-forcing.
And since there's only one thread on each slave receiving transactions
from its master they are queued and applied in one go now and then like:

- append all queued transactions to log
- force log
- apply all queued transactions to store
Fixes BackupServiceIT to properly close log channel after latest changes
Batch importer input from csv files

Initially from Michael Hunger, @jexp

Focuses on seeking in the raw character array stream from the provided
Readable and tries to avoid creating Strings as far as possible. Value
extraction revolves around visiting the character array with an offset and
length and extract the type of value requested.

Joined the Iterable<InputNode> and Iterable<InputRelationship> into an
Input argument to the BatchImporter and added a CsvInput implementation
with factory for header information, possible to read from the provided
node/relationship data files or from any source.

Also added a side-kick thread, wrapping any Readable reading a chunk ahead
in a separate thread so that the actual thread reading input will not have
to wait for I/O.
Deleted nodes includes deleted dynamic label records

If a node that got deleted had dynamic label records they weren't
included in the "after" state of a node record, which means they wouldn't
be deleted when applying that node command on the store. Later on such
dynamic records would be viewed as inconsistencies since their owner was
not in use anymore.

This issue was recently introduced where some amount of cleverness was
removed from the store applier, cleverness including looking at
before/after start and merging the two, infering which records should be
deleted.

Now when writing a node record its dynamic records are always written to
the log, and always read back when reading from the log. Also when
deleting a node simply mark all dynamic label records as not in use
instead of clearing the list on the node record itself. This go hand in
hand with what is done around dynamic records in property records.
Fix an ABA bug in the page cache

We were reusing the MuninnPage objects in the MuninnPageCache.freelist.
This could lead to cycles in the freelist through an ABA-bug.

The test that exposed that bug is ignored for now, because it is exposing
another bug that I thought was just a different manifestation of the ABA-bug.
Splits UpdatePuller into two roles: obligation fulfiller and update puller
Added tests for unexpected/invalid input data
Merge pull request #3236 from tinwelint/2.2-single-update-puller

[2.2] single update puller in HA
Merge pull request #3201 from tinwelint/2.2-del-dyn-label-records-w-del-node

[2.2] Deleted nodes includes deleted dynamic label records
Fixes an issue which made it impossible to resume a migration

i.e. when the migration had been completed, and the migration aborted...
when it would be picked up again the next time to do the moving of files
from migration directory to store directory there would be an assumption
that the "migrate" method would have been run before it. This led to an
NPE for an uninitialized field.
Merge pull request #3196 from tinwelint/2.2-batch-import-csv-input

[2.2] Batch importer input from csv files