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

PMM-10684 Clickhouse v2. #1542

Merged
merged 15 commits into from
Jun 18, 2024
Merged

PMM-10684 Clickhouse v2. #1542

merged 15 commits into from
Jun 18, 2024

Conversation

JiriCtvrtka
Copy link
Contributor

@JiriCtvrtka JiriCtvrtka commented Jan 4, 2023

@codecov
Copy link

codecov bot commented Jan 4, 2023

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 44.47%. Comparing base (66f7907) to head (3a02a10).

Files Patch % Lines
managed/utils/envvars/parser.go 0.00% 1 Missing ⚠️
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              
Flag Coverage Δ
admin 11.65% <ø> (ø)
agent 52.74% <ø> (ø)
managed 46.49% <0.00%> (-0.01%) ⬇️
vmproxy 66.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JiriCtvrtka JiriCtvrtka changed the title PMM-10684 Update clickhouse version to v2. PMM-10684 Clickhouse v2. Mar 21, 2024
@JiriCtvrtka JiriCtvrtka marked this pull request as ready for review March 22, 2024 08:07
@JiriCtvrtka JiriCtvrtka requested review from a team as code owners March 22, 2024 08:07
@JiriCtvrtka JiriCtvrtka requested review from ademidoff, BupycHuk and idoqo and removed request for a team March 22, 2024 08:07
Copy link
Member

@ademidoff ademidoff left a 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", "")
Copy link
Member

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?

Copy link
Member

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 )

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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

## Available test environment variables:

Copy link
Member

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.

Copy link
Member

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

Copy link
Contributor Author

@JiriCtvrtka JiriCtvrtka Mar 22, 2024

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.

Copy link
Member

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

Copy link
Member

@BupycHuk BupycHuk left a 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", "")
Copy link
Member

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?

}

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")
Copy link
Member

Choose a reason for hiding this comment

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

require.Nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

@JiriCtvrtka JiriCtvrtka changed the base branch from main to v3 March 22, 2024 09:34
@JiriCtvrtka JiriCtvrtka changed the base branch from v3 to main March 22, 2024 09:41
@JiriCtvrtka JiriCtvrtka changed the base branch from main to v3 March 22, 2024 09:41
@@ -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` | |
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added back with description.

@JiriCtvrtka JiriCtvrtka enabled auto-merge (squash) June 18, 2024 09:09
@JiriCtvrtka JiriCtvrtka merged commit cd40e7a into v3 Jun 18, 2024
28 checks passed
@JiriCtvrtka JiriCtvrtka deleted the PMM-10684-clickhouse-v2 branch June 18, 2024 09:19
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.

5 participants