Skip to content

Conversation

@candiduslynx
Copy link
Contributor

Extracted from #13492 & #13553

BEGIN_COMMIT_OVERRIDE
feat: Update github.com/cloudquery/plugin-sdk/v4 to v4.6.1 ()
fix: Perform delete-stale for the tables with no primary keys, too
END_COMMIT_OVERRIDE

@candiduslynx candiduslynx requested review from a team, bbernays and hermanschaaf and removed request for a team September 1, 2023 12:51
req := deletebyquery.NewRequest()
req.Query = &q
return c.deleteStaleIndex(gctx, msg.TableName, req)
return c.deleteStaleIndex(gctx, msg.TableName+"*", req)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

as we write to a table.Name + "-" + syncTime.Format(tine.DateOnly) for tables with no PK

resp, err := c.client.Bulk(bytes.NewReader(buf.Bytes()),
c.client.Bulk.WithContext(ctx),
c.client.Bulk.WithIndex(index),
c.client.Bulk.WithRefresh("wait_for"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

required to flush the data before the write returns (either this or we do the refresh before the delete stale)

@candiduslynx candiduslynx added the automerge Automatically merge once required checks pass label Sep 1, 2023
@candiduslynx candiduslynx removed the request for review from bbernays September 1, 2023 12:59
@kodiakhq kodiakhq bot merged commit 2ef2597 into main Sep 1, 2023
@kodiakhq kodiakhq bot deleted the feat/plugin-sdk-4.6.1/elasticsearch branch September 1, 2023 13:16
hermanschaaf added a commit that referenced this pull request Sep 1, 2023
hermanschaaf added a commit that referenced this pull request Sep 1, 2023
…4.6.1`" (#13589)

Reverts #13586

Deleting from all indexes matching the `*` pattern can have unintended
consequences, especially as far as performance is concerned. I think we
need to find another solution to the problem of not knowing whether a
sync is being done in `append` mode or `overwrite` mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants