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

Increase timeout from 1 minute to 30 minutes #98

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nickvanw
Copy link
Contributor

Experimental.

case out := <-tableState:
ch.Logger.Log(internal.LOGLEVEL_INFO, "done syncing "+out.shardName)
if out.err != nil {
ch.Logger.Error(err.Error())

Choose a reason for hiding this comment

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

Suggested change
ch.Logger.Error(err.Error())
ch.Logger.Error(out.err.Error())

@@ -281,9 +282,11 @@ func (p PlanetScaleEdgeDatabase) sync(ctx context.Context, tc *psdbconnect.Table

// stop when we've reached the well known stop position for this sync session.
watchForVgGtidChange := false
lastRestCount := -1

Choose a reason for hiding this comment

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

what does Rest mean in this context?

Choose a reason for hiding this comment

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

i guess last result len

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's probably not a great variable name

@@ -314,9 +318,13 @@ func (p PlanetScaleEdgeDatabase) sync(ctx context.Context, tc *psdbconnect.Table
}
}

if watchForVgGtidChange && tc.Position != stopPosition {
if (watchForVgGtidChange && tc.Position != stopPosition) || (lastRestCount == 0 && len(res.Result) == 0 && tc.Position == stopPosition) {

Choose a reason for hiding this comment

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

am i reading this right: stop if there are two empty results in a row and we've reached the stop position?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's the idea. In testing, for a database with data and no active writes, this tended to be indicative of the stream being caught up.

The existing behavior will just wait for a timeout in that situation, which seems unwise if we are going to increase the timeout.

return tc, io.EOF
}

if !(lastRestCount == -1 && len(res.Result) == 0) {

Choose a reason for hiding this comment

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

what's the reason for this guard?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In testing, the initial copy phase would trigger the condition above without this, but I don't precisely know why. Experimental!

@@ -157,7 +157,6 @@ func ReadCommand(ch *Helper) *cobra.Command {
}
}

ch.Logger.Log(internal.LOGLEVEL_INFO, "done done")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

@@ -37,6 +37,8 @@ type PlanetScaleEdgeDatabase struct {
Logger AirbyteLogger
Copy link
Contributor

Choose a reason for hiding this comment

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

For my own clarification, what will Logger be responsible for vs dataLogger?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think, if this ends up being good for the customer, we should separate the "data logger" and the info logger - one of them can be shared across every sync job, one of them can be specific per sync.

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