Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way for a replication plugin to refuse attachment [CORE6540] #6767

Closed
firebird-automations opened this issue Apr 15, 2021 · 3 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @aafemt

If it is not too late the signature of IReplicatedSession::setAttachment() should be changed to "bool setAttachment(Status status, Attachment attachment)" to let replication plugin refuse replication of this attachment for any reason (configuration option, "bad" user name, etc) with an optional error message.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@dyemanov
Copy link
Member

dyemanov commented Apr 26, 2021

Do you mean that the optional message is taken from the status argument and printed to the log? This may be OK only if a warning is returned (and log_errors is enabled in the config). If error is returned, this would be a critical "no-go" condition (as for any other errors).

So I have no problems adding a status and making the method returning bool, so that it would behave similar to startTransaction() -- i.e. false result without error in the status means silently disabled replication for this attachment. If warning is present in the status, then it will be logged (if configured).

Also, if we agree on the rules above, then perhaps this method should better be renamed to something like initialize().

@aafemt
Copy link
Contributor

aafemt commented Apr 26, 2021

I have no problems adding a status and making the method returning bool, so that it would behave similar to startTransaction() -- i.e. false result without error in the status means silently disabled replication for this attachment. If warning is present in the status, then it will be logged (if configured).

This is exactly what I had on mind.

Also, if we agree on the rules above, then perhaps this method should better be renamed to something like initialize().

Best of all would be add the attachment to parameters of plugin's factory but whole current plugin architecture is against it.

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

No branches or pull requests

3 participants