-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: main
Are you sure you want to change the base?
Conversation
case out := <-tableState: | ||
ch.Logger.Log(internal.LOGLEVEL_INFO, "done syncing "+out.shardName) | ||
if out.err != nil { | ||
ch.Logger.Error(err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
cmd/airbyte-source/read.go
Outdated
@@ -157,7 +157,6 @@ func ReadCommand(ch *Helper) *cobra.Command { | |||
} | |||
} | |||
|
|||
ch.Logger.Log(internal.LOGLEVEL_INFO, "done done") |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
Experimental.