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

HIVE-28759: Hive Query History - records are failed to be written due to iceberg worker pools shut down #5642

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abstractdog
Copy link
Contributor

@abstractdog abstractdog commented Feb 15, 2025

What changes were proposed in this pull request?

Replaces iceberg's worker thread pool with a same-sized one that accepts tasks after jvm shutdown hook.

Why are the changes needed?

Described on jira, tldr, to make query history able to flush records on hs2 shutdown.

Does this PR introduce any user-facing change?

No.

Is the change a dependency upgrade?

No.

How was this patch tested?

Manually tested on local MiniHS2 and Cloudera Data Warehouse, the HS2 showed that the full commit process ran successfully. Without the patch, the RejectedExecutionException was present in both scenarios.

… to iceberg worker pools shut down

Change-Id: I0baacca4020241e2cf892990f246da0adccf253b

int poolSize = getIcebergWorkerPoolSize();
LOG.info("Overriding iceberg worker pool, size: {}", poolSize);
field.set(null, Executors.newFixedThreadPool(poolSize,
Copy link
Member

@deniskuzZ deniskuzZ Feb 18, 2025

Choose a reason for hiding this comment

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

this is a hack! we shouldn't touch iceberg-worker-pool just for the sake of query history.

Copy link
Contributor Author

@abstractdog abstractdog Feb 18, 2025

Choose a reason for hiding this comment

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

totally understand your concern
do you think this is something to work on the iceberg side? I mean, iceberg worker pool allows tasks to finish 120s after the shutdown, but doesn't let any tasks be submitted, which is very unfortunate (we have quite short tasks here to flush the leftover records, just cannot make it happen)
so the problem is theoretically with the hack itself or the fact I'm trying to submit a task in a shutdown hook in hs2?

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

Successfully merging this pull request may close these issues.

3 participants