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

Add secor.max.active.files property to controll active file count #1443

Merged

Conversation

pdambrauskas
Copy link
Contributor

Partially addresses #785

Keeps active file under secor.max.file.count (default 100)

@HenryCaiHaiying , what do you think, is this the right way to approach this problem? I was thinking, maybe Files should be sorted by size before calling checkTopicPartition so that the biggest file is uploaded first, but decided to keep that simple for now.

Tried it for our use case (big number of partitions in small amount of time) it helped with OutOfMemory exception.

@pdambrauskas pdambrauskas changed the title Add secor.max.active.files property controll active file count Add secor.max.active.files property to controll active file count Jul 8, 2020
@@ -277,6 +277,10 @@ public long getMaxFileAgeSeconds() {
return getLong("secor.max.file.age.seconds");
}

public int getMaxActiveFiles() {
return getInt("secor.max.file.count", 100);
Copy link
Contributor

Choose a reason for hiding this comment

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

How about we set the default to -1, and on the caller side if getMaxActiveFiles returns -1 it will not forceUpload, this way we can maintain the backward compatible behavior for the installations who didn't face memory problem.

@HenryCaiHaiying
Copy link
Contributor

Looks good to me, I left a small comment in the code for backward compatible behavior. And I don't think we should sort the files since that would change the file uploading order, some people might not like that.

@pdambrauskas
Copy link
Contributor Author

@HenryCaiHaiying updated. Changed default value to -1 and made feature effective, only when value is > -1.

@HenryCaiHaiying HenryCaiHaiying merged commit a633910 into pinterest:master Jul 9, 2020
@HenryCaiHaiying
Copy link
Contributor

Looks good to me, thanks for the contribution.

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

2 participants