hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <>
Subject [jira] [Work logged] (HIVE-19261) Avro SerDe's InstanceCache should not be synchronized on retrieve
Date Wed, 09 Oct 2019 16:05:00 GMT


ASF GitHub Bot logged work on HIVE-19261:

                Author: ASF GitHub Bot
            Created on: 09/Oct/19 16:04
            Start Date: 09/Oct/19 16:04
    Worklog Time Spent: 10m 
      Work Description: xhumanoid commented on pull request #807: HIVE-19261: Avro SerDe's
InstanceCache should not be synchronized on retrieve
   Remove synchronization on cache retrieve have big performance impact
   will be great to have in branch-3 also
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

Issue Time Tracking

            Worklog Id:     (was: 325789)
    Remaining Estimate: 0h
            Time Spent: 10m

> Avro SerDe's InstanceCache should not be synchronized on retrieve
> -----------------------------------------------------------------
>                 Key: HIVE-19261
>                 URL:
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Fangshi Li
>            Assignee: Fangshi Li
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-19261.1.patch
>          Time Spent: 10m
>  Remaining Estimate: 0h
> In HIVE-16175, upstream made a patch to fix the thread safety issue in AvroSerDe's InstanceCache.
This fix made the retrieve method in InstanceCache synchronized. While it should make InstanceCache
thread-safe, making retrieve synchronized for the cache can be expensive in highly concurrent environment
like Spark, as multiple threads need to be synchronized on entering the entire retrieve method.
> We are proposing another way to fix this thread safety issue by making the underlying
map of InstanceCache as ConcurrentHashMap. Ideally, we can use atomic computeIfAbsent in
the retrieve method to avoid synchronizing the entire method.
> While computeIfAbsent is only available on java 8 and java 7 is still supported in Hive,
> we use a pattern to simulate the behavior of computeIfAbsent. In the future, we should
move to computeIfAbsent when Hive requires java 8.

This message was sent by Atlassian Jira

View raw message