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

Supported replication protocol(s) [CORE6537] #6764

Open
firebird-automations opened this issue Apr 9, 2021 · 14 comments
Open

Supported replication protocol(s) [CORE6537] #6764

firebird-automations opened this issue Apr 9, 2021 · 14 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @aafemt

It would be good to have a way to find out which protocols (block formats) are supported by IReplicator interface.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@dyemanov
Copy link
Member

I'm wondering whether it makes sense to add a multi-purpose getInfo() method similar to what we have in other interfaces. This would be consistent, even if looking too much "legacy".

@aafemt
Copy link
Contributor

aafemt commented Apr 26, 2021

Taking into account that IReplicator is received from IAttachment and has no additional properties (in contrast to ITransaction for example), personal getInfo() in it may be an overkill. A new item for IAttachment::getInfo() could be enough.

@dyemanov
Copy link
Member

Don't you think there could be other replication related info items in the future? Statistics (number of replicated blocks / transactions / records), for example?

@AlexPeshkoff
Copy link
Member

I suggest to take a look at all this from one more point - can attachment have >1 replicator? If not in v.4 - take into an account what can be later, in theory, etc. If yes - having getInfo() in IReplicator is close to unavoidable, cause different replicators may have different properties.

@dyemanov
Copy link
Member

I expect to have multiple replicators per attachment in the future.

@AlexPeshkoff
Copy link
Member

In that case using getInfo() in attachment to obtain information about replicators would be very bad API - each time one will have to provide info about what replicator that info will be. Even list of protocols can be different - for example due to configuration issues.

@aafemt
Copy link
Contributor

aafemt commented Apr 26, 2021

Don't you think there could be other replication related info items in the future? Statistics (number of replicated blocks / transactions / records), for example?

So far I see no use for such items. All stats can be counted during block building and the block is either applied as whole or rejected.

different replicators may have different properties.

There is no way to set them. createReplicator() has nothing like Replication Parameters Block among parameters and the same configuration is unavoidable applied to all IReplicator instances created from the same IAttachment.

@dyemanov
Copy link
Member

dyemanov commented May 1, 2021

Now I start to question the idea about multiple replicators myself. The original goals I had in mind are:

  1. parallel load of the single data stream
  2. replication from multiple sources

(1) is not going to work in a single attachment due to its serialization. (2) may load multiple streams independently, but again not in the really parallel mode. This makes the whole idea rather useless, I'm afraid. Can we think of any other possible use for multiple replicators per attachment?

@aafemt
Copy link
Contributor

aafemt commented May 1, 2021

Why I like to have them is errors' handling. If separate instances of Replicator is used for each transaction and something bad happen you can just kill one instance and don't care about interference with others.

For single instance model the whole separate interface is meaningless and "process" method may become a method on Attachment or (even better) Transaction.

@dyemanov
Copy link
Member

dyemanov commented May 1, 2021

Well, given that we allow multiple transactions per attachment that cannot execute in parallel either, having multiple replicators looks consistent.

@dyemanov
Copy link
Member

@aafemt, what particular format do you prefer?
<count><num1>...<numN> in no particular order? Ordered?
<numMIN><numMAX>?
Something else?

@aafemt
Copy link
Contributor

aafemt commented Jan 24, 2024

Taking into account the usage even simple <current> would be enough.
If application can use only too old protocol at max - asking is useless, an error on attempt to use it is enough. If application can use only too new protocol - the same. If application supports a range of protocols - the newest recognizable by server one is what is supposed to be used. That's why it is enough to know latest version supported by server.

@aafemt
Copy link
Contributor

aafemt commented Jan 24, 2024

And if you are going to have IReplicator::getInfo() call then separate items minProtocol and maxProtocol are better than single item with complex internal format.

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

4 participants