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

Force async_insert=0 when setting the exactlyOnce keeper values #298

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

Paultagoras
Copy link
Contributor

Summary

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@Paultagoras Paultagoras self-assigned this Jan 11, 2024
@Paultagoras Paultagoras linked an issue Jan 11, 2024 that may be closed by this pull request
Copy link
Member

@mshustov mshustov left a comment

Choose a reason for hiding this comment

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

we should properly support async_insert, not fight it

@Paultagoras Paultagoras requested a review from mshustov January 18, 2024 15:16
@@ -109,7 +109,7 @@ public void setStateRecord(StateRecord stateRecord) {
long maxOffset = stateRecord.getMaxOffset();
String key = stateRecord.getTopicAndPartitionKey();
String state = stateRecord.getState().toString();
String insertStr = String.format("INSERT INTO `%s` values ('%s', %d, %d, '%s');", csc.getZkDatabase() ,key, minOffset, maxOffset, state);
String insertStr = String.format("INSERT INTO `%s` SETTINGS wait_for_async_insert=1 VALUES ('%s', %d, %d, '%s');", csc.getZkDatabase() ,key, minOffset, maxOffset, state);
Copy link
Member

Choose a reason for hiding this comment

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

How does ClickHouse handle the setting in the case of synchronous insert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I checked the documentation (and when I ran it) I didn't see any issues - that's actually the default value. I just had it to force it, in case someone decides to disable.

@Paultagoras Paultagoras requested a review from mshustov January 22, 2024 16:09
@Paultagoras Paultagoras merged commit 693f3c4 into main Jan 22, 2024
1 check passed
@Paultagoras Paultagoras deleted the force-sync-state-insert branch January 22, 2024 21:23
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.

Async inserts and connect_state
2 participants