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

Fix unable to capture changes while concurrent writes #36

Merged
merged 5 commits into from
Oct 18, 2019

Conversation

lasanthaS
Copy link
Contributor

@lasanthaS lasanthaS commented Oct 17, 2019

Purpose

When concurrent/out-of-order writes for the auto-increment column occurs in the database, the source cannot capture such events in the polling mode.

Resolves #31

Goals

This PR introduces a strategy to handle such events by waiting on missing records.

Approach

When the wait.on.missed.record parameter is set to true, the source expects polling.column values in (numeric) sequential order. For each record, the source generates an event. When reading and processing records in batches, if the source identifies a missed record it pauses the processing and waits until the missing record appears. If the missing record does not appear for missed.record.waiting.timeout time period (in seconds), it ignores the record and resumes processing the rest.

Security checks

@suhothayan
Copy link
Contributor

Do we need to have a retry interval too? Can’t it just be the polling interval

@lasanthaS
Copy link
Contributor Author

Do we need to have a retry interval too? Can’t it just be the polling interval

Yes, we can have the polling interval as the retry interval. The intention to introduce the retry interval was to reduce the waiting time and resume the process as quickly as possible.

}
Thread.sleep((long) pollingInterval * 1000);
} catch (InterruptedException e) {
log.error("Error while polling. Current mode: " + CDCSourceConstants.MODE_POLLING, e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please improve the errors with the stream and App name information... else it will be hard to troubleshoot. please fix this for all cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in b221509.

@suhothayan suhothayan merged commit 6c428ed into siddhi-io:siddhi-4.x.x Oct 18, 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.

2 participants