(#17842) Return meaningful errors with invalid resource references

Normally this kind of thing isn't allowed:

    file { '/tmp/foo':
      ensure => present,
      require => Mymodule::foo['bar'],
    }

However puppet lets it slip by when someone uses create resources:

    create_resources('file', { '/usr/local/homeaway/api-favorites-ustst1-jdk/java' => { ensure => present, require => "Mymodule::foo[bar]" }})

With the puppetdb terminus, our relationship checks fail when this kind of
delcaration is used, however in the compiler terminus it slips through because
I believe the comparison is done all in capitals.

Since the parser stops it, it shouldn't be allowed. However, our behaviour is
confusing to the user. This patch adds a more meaningful error message to this
kind of failure, instead of stating that it is a relationship error we stop
earlier with an error about the format.

Signed-off-by: Ken Barber <ken@bob.sh>
Raise Puppet::Error consistently in catalog indirector

Previously we were just raise exceptions with no specific exception, this patch
makes the behaviour consistent across the file. Tests updated also.

Signed-off-by: Ken Barber <ken@bob.sh>
Fix spelling in rspec test

I had fixed 'capitalization' in the code, but not in the test.

Signed-off-by: Ken Barber <ken@bob.sh>
(#19239) Work around EOFException upon journal corruption

We discovered a bug in KahaDB that when the journal is corrupted there might be
a stray EOFException that is not caught by the KahaDB store, however upon
broker restart it corrects itself.

This patch will automatically restart the broker when that state is detected,
avoiding the need for an administrator to intervene.

This also adds a section to documentation to explain how to recover from
KahaDB corruption errors manually.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #455 from kbarber/ticket/master/kahadb_fixes_and_resource_rels_cherry_pick

Ticket/master/kahadb fixes and resource rels cherry pick