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

Respect hive.metastore-stats-cache-ttl is explicitly set #19862

Conversation

findepi
Copy link
Member

@findepi findepi commented Nov 22, 2023

Remove the logic that would ignore hive.metastore-stats-cache-ttl set by the user, if the chosen value was less than the hive.metastore-cache-ttl value.

The logic's purpose was considered necessary to enable statistics cache by default, but the same goal can be achieved differently, by applying default value (fixed duration or hive.metastore-cache-ttl whichever is greater) only if the parameter was not set explicitly.

@findepi findepi added the no-release-notes This pull request does not require release notes entry label Nov 22, 2023
@cla-bot cla-bot bot added the cla-signed label Nov 22, 2023
@github-actions github-actions bot added tests:hive hive Hive connector labels Nov 22, 2023
Remove the logic that would ignore `hive.metastore-stats-cache-ttl` set
by the user, if the chosen value was less than the
`hive.metastore-cache-ttl` value.

The logic's purpose was considered necessary to enable statistics cache
by default, but the same goal can be achieved differently, by applying
default value (fixed duration or `hive.metastore-cache-ttl` whichever is
greater) only if the parameter was not set explicitly.
@findepi findepi force-pushed the findepi/respect-hive-metastore-stats-cache-ttl-is-explicitly-set-05b7fe branch from 58f41d3 to ca83b6a Compare November 22, 2023 13:29
Comment on lines +89 to +90
.setStatsCacheTtl(new Duration(135, MILLISECONDS))
.setMetastoreCacheTtl(new Duration(1111, DAYS))
Copy link
Member

Choose a reason for hiding this comment

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

Can we disallow this configuration ? I can't think of a good reason why someone would want statistics metadata ttl to be shorter than other metadata ttl.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we can. Neither I can think of a good reason why someone would want that. OTOH, these are separate configuration toggles, so unclear what we gain by disallowing certain configurations which just work otherwise.

Copy link
Member

Choose a reason for hiding this comment

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

Disallowing it prevents users from making a mistake in the configuration and saves debugging time for us.

Copy link
Member Author

Choose a reason for hiding this comment

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

There are two toggles

  • A hive.metastore-cache-ttl
  • B hive.metastore-stats-cache-ttl

if B < A, we can call it a mistake and reject. Do we have guarantee this is a mistake?
Or we risk that we gonna need to spend time explaining why we thought this is a good idea to reject such configurations?

BTW I think this discussion isn't very important. The whole problem comes from the fact that separate hive.metastore-stats-cache-ttl toggle was introduced so that it can be enabled by default. This PR doesn't change anything with respect to this main issue -- being enabled by default; default behavior doesn't change. So I guess we're spending time about some edge case.

Copy link
Member Author

Choose a reason for hiding this comment

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

discussed offline and concluded this will be as it is for now at least

@findepi
Copy link
Member Author

findepi commented Nov 23, 2023

Thanks @raunaqmorarka @sopel39 for your detailed review!

@findepi findepi merged commit 193a8ab into trinodb:master Nov 23, 2023
57 checks passed
@findepi findepi deleted the findepi/respect-hive-metastore-stats-cache-ttl-is-explicitly-set-05b7fe branch November 23, 2023 10:40
@github-actions github-actions bot added this to the 434 milestone Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed hive Hive connector no-release-notes This pull request does not require release notes entry
Development

Successfully merging this pull request may close these issues.

None yet

3 participants