-
Notifications
You must be signed in to change notification settings - Fork 134
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
PMM-10684 Clickhouse v2. #1542
PMM-10684 Clickhouse v2. #1542
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v3 #1542 +/- ##
==========================================
- Coverage 44.48% 44.47% -0.01%
==========================================
Files 368 368
Lines 35586 35582 -4
==========================================
- Hits 15829 15825 -4
Misses 18130 18130
Partials 1627 1627
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
7579b3b
to
c7da376
Compare
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.
👍
@@ -425,8 +425,6 @@ func (s *Service) marshalConfig(tmpl *template.Template, settings *models.Settin | |||
clickhouseDatabase := getValueFromENV("PERCONA_TEST_PMM_CLICKHOUSE_DATABASE", defaultClickhouseDatabase) | |||
clickhouseAddr := getValueFromENV("PERCONA_TEST_PMM_CLICKHOUSE_ADDR", defaultClickhouseAddr) | |||
clickhouseDataSourceAddr := getValueFromENV("PERCONA_TEST_PMM_CLICKHOUSE_DATASOURCE_ADDR", defaultClickhouseDataSourceAddr) | |||
clickhousePoolSize := getValueFromENV("PERCONA_TEST_PMM_CLICKHOUSE_POOL_SIZE", "") |
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.
Did they remove these two params from the client?
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.
OK, I see the commit message - it's no longer supported )
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 v2 pool size and block size changed. It is also recommended to set them agains exact DB.
See: https://clickhouse.com/docs/en/integrations/go
MaxIdleConns should be alternative for pool size
BlockBufferSize for block size
But our block size default was 10 000 and BlockBufferSize did not accept such number, only lower ones, like 100.
time="2024-03-22T07:35:19.278+00:00" level=info msg="DSN: clickhouse://127.0.0.1:9000/pmm?block_buffer_size=10000&max_idle_conns=2" component=main stdlog: Connection: strconv.ParseUint: parsing "10000": value out of range
So seems it is slightly different. MaxIdleConns should behave same like pool size, but since both of them are with prefix "PERCONA_TEST" I decided to remove them.
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.
Should the PR be against v3 branch?
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.
My fault. Thanks for notice that.
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.
Don't we treat variables prefixed with PERCONA_TEST_
as non-public, internal ones?
I'm referring to
Line 54 in 70d5afd
## Available test environment variables: |
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 mean they should be used in non-prod environments, i.e. test environments.
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.
You are right, seems like we can merge it to PMM 2 as well
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.
@BupycHuk So should I change it to v2 (ticket and PR)? Thanks.
If yes, I will keep this one to merge it into v3 and for v2 I will create another PR and update ticket.
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.
let's do it for v3 now, later we can backport to v2
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.
looks good to me, but I think it's better to do it in v3 branch since we are removing some env variables.
@@ -425,8 +425,6 @@ func (s *Service) marshalConfig(tmpl *template.Template, settings *models.Settin | |||
clickhouseDatabase := getValueFromENV("PERCONA_TEST_PMM_CLICKHOUSE_DATABASE", defaultClickhouseDatabase) | |||
clickhouseAddr := getValueFromENV("PERCONA_TEST_PMM_CLICKHOUSE_ADDR", defaultClickhouseAddr) | |||
clickhouseDataSourceAddr := getValueFromENV("PERCONA_TEST_PMM_CLICKHOUSE_DATASOURCE_ADDR", defaultClickhouseDataSourceAddr) | |||
clickhousePoolSize := getValueFromENV("PERCONA_TEST_PMM_CLICKHOUSE_POOL_SIZE", "") |
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.
Should the PR be against v3 branch?
qan-api2/db_test.go
Outdated
} | ||
|
||
db := createDB(dsn) | ||
|
||
require.Equal(t, db, nil, "Check connection after we create database") | ||
require.Equal(t, nil, db, "Check connection after we create database") |
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.
require.Nil
?
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.
Changed.
00c0d01
to
6e644ea
Compare
6c41623
to
0ee113b
Compare
@@ -26,11 +26,9 @@ Below is a list of affected variables and their new names. | |||
| `PERCONA_TEST_CHECKS_PUBLIC_KEY` | | Removed in PMM v3, use `PMM_DEV_PERCONA_PLATFORM_PUBLIC_KEY` | | |||
| `PERCONA_TEST_NICER_API` | `PMM_NICER_API` | | | |||
| `PERCONA_TEST_PMM_CLICKHOUSE_ADDR` | `PMM_CLICKHOUSE_ADDR` | | | |||
| `PERCONA_TEST_PMM_CLICKHOUSE_BLOCK_SIZE` | `PMM_CLICKHOUSE_BLOCK_SIZE` | | |
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 that since the variables still exist in v2, it's better we keep them here and mention that they're now removed in v3 in the comments column.
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.
Added back with description.
PMM-10684
Build: Percona-Lab/pmm-submodules#3596