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

use lower of configure timeout and time till midnight #15

Open
wants to merge 1 commit into
base: v0.37
Choose a base branch
from

Conversation

anil-db
Copy link
Collaborator

@anil-db anil-db commented May 29, 2024

when key_prefix in sync have date=%F at mid night a new batch is started and old batch stop getting new data.
if old batch is not full (due to size) it will wait for timeout secs before it is uploaded.
till then it keeps the underlying disk buffer files. since all disk buffer for a sink is shared and behave as a sequential tape and ack pointer does not move (because previous day buffer is not uploaded) it hold all requests in disk buffer even some recent batch have been uploaded. a disk buffer full trigger block in full and request timeout happens.

in this PR we set the batch timeout to either configured 180s or close to midnight (midnight + 10 sec) which ever is lower. this flushes the previous day buffer quickly and do not cause disk buffer full and blocking and request timeout due to that.

tested in staging-aws-us-west-2-general1 with manual deployment. no midnight drop seen.

Screenshot 2024-05-31 at 9 56 49 AM

logs
Screenshot 2024-05-31 at 10 08 18 AM

Cargo.toml Dismissed Show dismissed Hide dismissed
@@ -203,6 +209,15 @@ where
stream: Fuse<St>,
}

fn duration_till_midnight() -> Duration {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

refactor function to take secs from midnight as param.

}

fn insert_with_max_delay(&mut self, item_key: K, max_delay: Duration) {
info!(message = "max_delay and timeout", max_delay = ?max_delay, timeout = ?self.timeout);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

change from info to debug or print only when max is less than configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant