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

Postgres: Handle negative replication delay #977

Merged
merged 1 commit into from
Jun 12, 2014
Merged

Postgres: Handle negative replication delay #977

merged 1 commit into from
Jun 12, 2014

Conversation

Tenzer
Copy link
Contributor

@Tenzer Tenzer commented Jun 12, 2014

In case the master and slave's clocks are slightly out of sync, and there is virtually no replication delay, we may experience that a negative timedelta in the replication delay check. That is however not detected in the current code, as Python sets the days property to -1 and seconds to 86400, in order to not have a negative number in the seconds property.

This change checks if days is a negative number, and if it is, we always send 0 seconds as the replication delay.

There's an example of how it can look if it isn't fixed here:
replication-delay-example

@remh
Copy link

remh commented Jun 12, 2014

Thanks @Tenzer ! It looks good to me, i'll make a few tests and merge it really soon!

@remh
Copy link

remh commented Jun 12, 2014

Thanks!

remh pushed a commit that referenced this pull request Jun 12, 2014
Postgres: Handle negative replication delay
@remh remh merged commit 7971289 into DataDog:master Jun 12, 2014
@Tenzer Tenzer deleted the negative-replication-delay branch June 16, 2014 10:09
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