Skip to content

HIVE-29670: Avoid overwriting read-only DB_NOTIFICATION_EVENT_ID_KEY_NAME in DbNotificationListener when processing batched partition events#6548

Draft
Aggarwal-Raghav wants to merge 1 commit into
apache:masterfrom
Aggarwal-Raghav:HIVE-29670

Conversation

@Aggarwal-Raghav

@Aggarwal-Raghav Aggarwal-Raghav commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Check JIRA HIVE-29670 for stacktrace.

Why are the changes needed?

Alter partitions fails to update stats for more than 1 batch (metastore.jdbc.max.batch.size) of partitions. local-setup-hs2.log

Does this PR introduce any user-facing change?

No

How was this patch tested?

Using q file and local hive setup testing

mvn clean test -Dtest=TestMiniLlapLocalCliDriver -Dqfile=db_notification_batch_insert.q -Drat.skip -Pitests -pl itests/qtest

…NAME in DbNotificationListener when processing batched partition events
@Aggarwal-Raghav

Aggarwal-Raghav commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

CC @dengzhhu653 , can you please help with the feedback here! Related to HIVE-27746

On debugging, I found the same event object is being overridden in while loop in DbNotificationListener#onAlterPartitions() .

  1. For 1st batch of partitions process() is triggered and set's the DB_NOTIFICATION_EVENT_ID_KEY_NAME

  2. But for next batch same event object is passed to process() and putParameterIfAbsent() throws IllegalStateException ❌

Before:
BEFORE_FIX

After:
After_FIX

@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants