-
Notifications
You must be signed in to change notification settings - Fork 820
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
Feature/lsn to bytes #25
Conversation
and make their behavior version specific
This method behaves differently depending on server version and will allow to use patroni with postgres older than 9.3
@@ -39,6 +35,7 @@ def parseurl(url): | |||
|
|||
|
|||
class Postgresql: | |||
_SERVER_VERSION = 90400 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In issue #18 it is already mentioned that we might be able to support 9.3, can we make this a non-magic variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default we assume that we are running on 9.4
Postgres version determine default behaviour of lsn_to_bytes and bytes_to_lsn methods.
When connection to instance is established this value would be overwritten with actual value (see line 85)
+1 |
Why are we calculating LSN to Bytes in the python code at all? Why not just pull it from the database when we pull the LSN? |
If that wasn't clear: -1 from me. Supporting versions earlier than 9.3 is going to be difficult for several reasons, not the least of which is the lack of remastering support (and in 9.0, the lack of any kind of timeline switching). Given that adding the LSN function isn't sufficient to support 9.1 and 9.2, why clutter up the code? |
Drop unused functionality (lsn_to_bytes, bytes_to_lsn) Revert some changes.
Use different algorithm when calculating amount of bytes written to xlog depending on server version