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-26939 : Changed placement policy from NODE to node #3941

Merged
merged 1 commit into from Jan 29, 2023

Conversation

amanraj2520
Copy link
Contributor

JIRA link : https://issues.apache.org/jira/browse/HIVE-26939

This is because llap_server uses templates.py yarnfile to bringup the LLAP Application Master which has the placement_policy as "NODE". Hadoop has started using 2.12.7 jackson version which has issues in parsing NODE to either [node, rack]. Therefore it is not able to cast the placement policy correctly.

Resolution : We will have to send placement_policy as "node" from the templates.py of Hive Llap Server module.

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

@amanraj2520
Copy link
Contributor Author

@abstractdog @zabetak Can you please review this.

@sonarcloud
Copy link

sonarcloud bot commented Jan 13, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@abstractdog
Copy link
Contributor

thanks for this patch @amanraj2520, just for clarity's sake, what kind of tests are affected by this issue if we upgrade to hadoop 3.3.4?

@amanraj2520
Copy link
Contributor Author

Hi @abstractdog Actually this error does not come up in a test until we manually bring up a cluster with Hive master and Hadoop 3.3.4. This error did not happen with hadoop 3.1.1 since at that time Hadoop was using Jackson 2.7.8 for deserializing this placement_policy yarnfile. Jackson 3.7.8 was able to deserialize it from "NODE" to "node" since it was case insensitive. Thus is found the [node] enum in the Hadoop PlacementScope class which in turn brought up the AM successfully. But Jackson 2.12.7 (Hadoop 3.3.4) is doing case sensitive parsing thereby not finding the relevant enum. Either we have to disable this configuration from jackson side 2.3/com/fasterxml/jackson/databind/MapperFeature.html#ACCEPT_CASE_INSENSITIVE_ENUMS or from Hive side we will have to send "node" as the placement policy. We can discuss on this Lazlo if you have doubts.

@amanraj2520
Copy link
Contributor Author

Also I think we should backport it to 4.0 Hive release if this looks good.

@amanraj2520
Copy link
Contributor Author

Hi @abstractdog
https://github.com/apache/hadoop/blob/a3b9c37a397ad4188041dd80621bdeefc46885f2/hadoop-project/pom.xml#L73

If you see Hadoop 3.3.1 uses 2.10.x databind, in which I think this issue will also come while bringing up LLAP AM. Since I think jackson has modified this case-sensitive comparison from 2.9. Anyhow it is better to change it to node since Hadoop expects it as [node,rack]

@amanraj2520
Copy link
Contributor Author

@abstractdog Can you please review this

1 similar comment
@amanraj2520
Copy link
Contributor Author

@abstractdog Can you please review this

@abstractdog
Copy link
Contributor

one more question @amanraj2520: isn't the same issue happening with "type": "ANTI_AFFINITY"?

@amanraj2520
Copy link
Contributor Author

Hi @abstractdog I do not think so. Because I was able to bring up the Hive LLAP with only change from NODE to node. But still will check this.

@amanraj2520
Copy link
Contributor Author

Hi @abstractdog got the reason why ANTI_AFFINITY does not matter. If you see Hadoop 3.3.4 is using ANTI_AFFINITY in Upper Case in the PlacementType.class. Attaching the snippet here :
image

Therefore it does not affect the jackson deserialization.

@amanraj2520
Copy link
Contributor Author

The basic issue with Jackson 2.12.7 is that it does cases sensitive parsing so the request initiator(Hive) and receiver(Hadoop) should match cases.

@abstractdog abstractdog self-requested a review January 29, 2023 15:31
Copy link
Contributor

@abstractdog abstractdog left a comment

Choose a reason for hiding this comment

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

+1

@abstractdog abstractdog merged commit ebca56c into apache:master Jan 29, 2023
yeahyung pushed a commit to yeahyung/hive that referenced this pull request Jul 20, 2023
…3.4 to parse correctly using Jackson 2.12.7 (apache#3941) (Aman Raj reviewed by Laszlo Bodor)
tarak271 pushed a commit to tarak271/hive-1 that referenced this pull request Dec 19, 2023
…3.4 to parse correctly using Jackson 2.12.7 (apache#3941) (Aman Raj reviewed by Laszlo Bodor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants