Skip to content

Allow decimal values in settings using seconds#37187

Merged
yakov-olkhovskiy merged 13 commits intoClickHouse:masterfrom
Algunenano:floating_seconds
May 31, 2022
Merged

Allow decimal values in settings using seconds#37187
yakov-olkhovskiy merged 13 commits intoClickHouse:masterfrom
Algunenano:floating_seconds

Conversation

@Algunenano
Copy link
Member

@Algunenano Algunenano commented May 13, 2022

Changelog category (leave one):

  • Backward Incompatible Change

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Changes how settings using seconds as type are parsed to support floating point values (for example: max_execution_time=0.5). Infinity or NaN values will throw an exception.

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

Maintains milliseconds as it was.
Closes #36940

@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-backward-incompatible Pull request with backwards incompatible changes label May 13, 2022
@Algunenano
Copy link
Member Author

Algunenano commented May 13, 2022

Apparently there are settings (drain_timeout) with seconds where negative values are ok (and have a meaning) so I'll remove that limitation.

@Algunenano
Copy link
Member Author

clang-tidy is complaining (without reason) but it can be workaround.
arm64 tests are failing at 01287_max_execution_speed which look unrelated since it's not using any seconds-unit settings.

@Algunenano
Copy link
Member Author

arm64 tests are failing at 01287_max_execution_speed which look unrelated since it's not using any seconds-unit settings.

Ok, nevermind. That test is setting

SET min_execution_speed_bytes = 800000000000, timeout_before_checking_execution_speed = 0.1;

The timeout_before_checking_execution_speed=0.1, as far as I can see, has never worked because it got truncated to 0. With the changes it respects the 0.1 and, as expected, will not check the execution time until it reaches 0.1 seconds. I guess that's why the test is failing.

I could find that the following tests are setting timeout_before_checking_execution_speed to a decimal value:

  • 01287_max_execution_speed.sql
  • 00156_max_execution_speed_sample_merge.sql
  • 01290_max_execution_speed_distributed.sql

I'm going to lower their values to 0 since that's what they were effectively using before.

Before the change to use floats, this settings were getting
0 as the parsed value, so keep the old value by setting to
zero explicitly
@Algunenano
Copy link
Member Author

Tests:

  • Stateless tests flaky check (address, actions): 01287_max_execution_speed fails because it's too long (under asan)
  • Stress tests: They are complaining about backward compatibility checks but I'm not sure what I'm supposed to be seeing / looking for there.

@yakov-olkhovskiy yakov-olkhovskiy self-assigned this May 17, 2022
Comment on lines 230 to 234
Copy link
Member

Choose a reason for hiding this comment

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

This change can be source of incompatibility for some weird cases, where we rely on integer. But overall shouldn't be an issue, I believe.

Copy link
Member Author

Choose a reason for hiding this comment

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

If you have any reservation about a specific case let me know and I'll add some extra tests to make sure everything works as expected.

Copy link
Member

Choose a reason for hiding this comment

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

frankly can't find anything at least in code... otherwise it will be a proper conversion I think.

Comment on lines 258 to 260
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to comment it in terms of lost precision for seconds due to requirements for backward compatibility - we will lose context of this PR in source code - will be not clear unchanged from what.

Copy link
Member Author

Choose a reason for hiding this comment

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

True. I'll improve the comment.

@yakov-olkhovskiy
Copy link
Member

@Algunenano 01287_max_execution_speed is failing due to different output
also 02294_floating_point_second_in_settings is failing

@Algunenano
Copy link
Member Author

Algunenano commented May 24, 2022

@Algunenano 01287_max_execution_speed is failing due to different output also 02294_floating_point_second_in_settings is failing

Thanks a lot for the ping. I have no idea what I did. I remember fixing those issues (and I even wrote about it) but they are broken, so not sure if I dreamed it or discard some changes during the rebase (Or I did it in the other PC and never pushed). I'll have a look and fix the issues. Sorry for the noise.

Update: Yes, I broke it during the rebase (because I switched computers and didn't pull the fixes I had done)

@yakov-olkhovskiy
Copy link
Member

@Algunenano BTW is this force-push made by github itself? I found that force-push often is very messy...

@Algunenano
Copy link
Member Author

BTW is this force-push made by github itself?

No. I did it because the branch was pretty old and rebased instead of merged master/HEAD.

@yakov-olkhovskiy
Copy link
Member

@Algunenano seems we hit a rare case of CI fluke here:
#37549
we need a new commit to rerun failed build - could you please try force push again?

@Algunenano
Copy link
Member Author

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented May 25, 2022

update

✅ Branch has been successfully updated

@Algunenano
Copy link
Member Author

I guess that you need any new commit so I've asked the bot to update the branch. If you actually need a force push let me know and I'll do it tomorrow.

@yakov-olkhovskiy
Copy link
Member

@mergify update

@mergify
Copy link
Contributor

mergify bot commented May 30, 2022

update

✅ Branch has been successfully updated

@yakov-olkhovskiy yakov-olkhovskiy merged commit c6b20cd into ClickHouse:master May 31, 2022

-- Ok values
SELECT 1 SETTINGS max_execution_time=-0.5;
SELECT 1 SETTINGS max_execution_time=0.5;
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll raise it. There are other test already covering 0.something so we don't need to keep a subsecond value here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backward-incompatible Pull request with backwards incompatible changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use floating point values to set time related settings

4 participants