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

Store only last 2 postgres timeline histories #651

Merged
merged 1 commit into from
Jun 3, 2019

Conversation

dineshba
Copy link
Contributor

Fixes #629

We have made changes to store last N (MaxPostgresTimelinesHistory) timeline histories. We have set the default value as 1000.

We introduced an interface PGManager to mock GetTimelinesHistory method in unit test.

Question:

  • Does it make sense to make MaxPostgresTimelinesHistory configurable through clusterspec?
  • What would be the suitable default value for MaxPostgresTimelinesHistory?

@dineshba dineshba force-pushed the max-timeline-history branch 3 times, most recently from c75713d to cece4a9 Compare May 25, 2019 12:51
@dineshba dineshba force-pushed the max-timeline-history branch from cece4a9 to 82325d6 Compare May 25, 2019 14:25
@sgotti
Copy link
Member

sgotti commented May 27, 2019

@dineshba Thanks for the PR!

TimeLineHistory is used to check that the current db is not diverged and is used in function isDifferentTimelineBranch in both keeper.go and sentinel.go (they are quite identical)

Looking at these functions logic we could theoretically just keep the last two timeline histories.

So we could avoid having an user defined (and unclear from the user point of view) parameter and just keep the last N (where N could be just the last 2 or be conservative and choose something like 10...)

@dineshba
Copy link
Contributor Author

Make sense @sgotti. It couldn't be user defined parameter. We can make N as 2. Will make the changes and update the PR.

@dineshba dineshba force-pushed the max-timeline-history branch 4 times, most recently from c472318 to 956394a Compare May 27, 2019 15:35
@dineshba
Copy link
Contributor Author

@sgotti Updated the PR with maxPostgresTimelinesHistory = 2(made it keeper.go level const declaration). Squashed and did force push to have clean history. Please refer it.

@dineshba dineshba changed the title Store only last N postgres timeline histories Store only last 2 postgres timeline histories May 27, 2019
Copy link
Member

@sgotti sgotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dineshba LGTM. Just a small nit.

internal/postgresql/postgresql.go Show resolved Hide resolved
@dineshba dineshba force-pushed the max-timeline-history branch 2 times, most recently from eb1ea03 to dd1acb0 Compare May 28, 2019 12:25
Co-authored-by: Arunvel Sriram <arunvelsriram@gmail.com>
@dineshba dineshba force-pushed the max-timeline-history branch from dd1acb0 to 07b9dfb Compare May 28, 2019 14:51
@sgotti
Copy link
Member

sgotti commented Jun 3, 2019

@dineshba Thanks! Merging.

@sgotti sgotti merged commit 6be3dfa into sorintlab:master Jun 3, 2019
@sgotti sgotti added this to the v0.14.0 milestone Jun 6, 2019
@arunvelsriram arunvelsriram mentioned this pull request Jun 7, 2019
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.

Clusterdata too large to store in consul
2 participants