Skip to content

Store only last 2 postgres timeline histories#651

Merged
sgotti merged 1 commit into
sorintlab:masterfrom
jskswamy:max-timeline-history
Jun 3, 2019
Merged

Store only last 2 postgres timeline histories#651
sgotti merged 1 commit into
sorintlab:masterfrom
jskswamy:max-timeline-history

Conversation

@dineshba

Copy link
Copy Markdown
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

sgotti commented May 27, 2019

Copy link
Copy Markdown
Member

@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
Copy Markdown
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
Copy Markdown
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

@sgotti sgotti left a comment

Copy link
Copy Markdown
Member

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.

Comment thread internal/postgresql/postgresql.go
@dineshba dineshba force-pushed the max-timeline-history branch 2 times, most recently from eb1ea03 to dd1acb0 Compare May 28, 2019 12:25
@dineshba dineshba force-pushed the max-timeline-history branch from dd1acb0 to 07b9dfb Compare May 28, 2019 14:51
@sgotti

sgotti commented Jun 3, 2019

Copy link
Copy Markdown
Member

@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