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

Feature/lsn to bytes #25

Merged
merged 5 commits into from
Sep 5, 2015
Merged

Feature/lsn to bytes #25

merged 5 commits into from
Sep 5, 2015

Conversation

CyberDem0n
Copy link
Collaborator

Use different algorithm when calculating amount of bytes written to xlog depending on server version

Alexander Kukushkin added 3 commits September 4, 2015 10:41
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
Copy link
Contributor

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?

Copy link
Collaborator Author

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)

@feikesteenbergen
Copy link
Contributor

+1

@jberkus
Copy link
Contributor

jberkus commented Sep 4, 2015

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?

@jberkus
Copy link
Contributor

jberkus commented Sep 4, 2015

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?

@CyberDem0n CyberDem0n merged commit ac2740e into master Sep 5, 2015
@CyberDem0n CyberDem0n deleted the feature/lsn-to-bytes branch September 5, 2015 13:29
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.

None yet

3 participants