-
Notifications
You must be signed in to change notification settings - Fork 136
refactor(postgres): pass context to database queries in chunk processing functions #361
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
Conversation
|
please review - @hash-data |
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.
Use QueryContext function in ChunkIterator function in postgres backfill.go.
@abhinav-1305
| err := p.client.QueryRowContext(ctx, nextChunkEnd).Scan(&chunkEnd) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("failed to query[%s] next chunk end: %s", nextChunkEnd, err) | ||
| } |
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.
Check for context in MySQL and MongoDB drivers as well, where ever there is a direct call for driver instance or server.
@abhinav-1305
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.
Can this be addressed in other pr?
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.
Can this be addressed in other pr?
Do changes in the CDC for postgres. For mongoDB you can raise another PR if there is any context changes, for the MySQL one please do changes here itself if possible. Pease check for CDC for other drivers as well.
| }) | ||
| } | ||
|
|
||
| func (p *Postgres) GetOrSplitChunks(_ context.Context, pool *destination.WriterPool, stream types.StreamInterface) (*types.Set[types.Chunk], 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.
in doesReplicationSlotExists as well use QueryRowContext
|
@abhinav-1305 , any update from your side. also change the merge branch to staging |
Description
Fixes #319
Type of change
How Has This Been Tested?
Screenshots or Recordings
Related PR's (If Any):