Skip to content

Conversation

@oalbrigt
Copy link
Contributor

  • add support for promotable variables
  • dont fail during validate-all action if notify != true (to avoid error and future fails during pcs resource create)
  • report NOT_RUNNING during probe-action when no database has been created or postgresql is not installed

- add support for promotable variables
- dont fail during validate-all action if notify != true (to avoid
  error and future fails during `pcs resource create`)
- report NOT_RUNNING during probe-action when no database has been
  created or postgresql is not installed
Copy link
Member

@ioguix ioguix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
Thanks for your patch.

As requested, I need some explanations for some of your change. Not sure why you need to ignore various test during the probe operation. If you don't want Pacemaker to check for PostgreSQL instance on some node, you probably want a rule to forbid it with resource-discovery=never set.

I agree the agent should not check everything during all actions. This is a long overdue fix. It would have been easier to discuss and merge this if that would have been a separate patch and PR though.

Same for OCF_RESKEY_CRM_meta_promoted_max changes.

# Pacemaker will give up before us and take decisions
my $timeout = ( _get_action_timeout() || 60*60*24 ) + 60;
my $rc = _runas( $PGISREADY, '-h', $pghost, '-p', $pgport, '-d', 'postgres', '-t', $timeout );
my $rc = _runas( $PGISREADY, '-q', '-h', $pghost, '-p', $pgport, '-d', 'postgres', '-t', $timeout );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the point of making pg_isready quiet?
I like having messages in debug level and there's very few messages from this in notice level…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont remember, but it might have been due to errors with if()'s expecting an int instead of a string.


ocf_exit_reason( 'Could not read all datas from controldata file for "%s"',
$datadir );
if ( ! ocf_is_probe() ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain or comment in code why you want to avoid to exit with an error during probe action?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the probe-action is run to identify whether the resource is running or not e.g. when you create a resource, and should report not running and not errors, so the cluster doesnt start fencing nodes if you run e.g. pcs resource create --disabled ... to be able to run debug-* actions or similar, or if you ban the resource from a node where the database isnt setup or present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants