[CARBONDATA-3900][CARBONDATA-3882][CARBONDATA-3881] Fix multiple concurrent issues in table status lock and segment lock for SI and maintable

Why is this PR needed?
[CARBONDATA-3900] Fix maintable load failure in concurrent load and compaction scenario
Main table load flow segment lock is released before updating the table status success.
So, concurrent operation was considering this segment as stale segment (as segment lock is not present) and cleaning it. Leading to unable to get file status exception.
[CARBONDATA-3882] Fix wrong lock and missing Table status lock in some SI flows
In updateLoadMetadataWithMergeStatus, we want update SI table status, but lock is acquired on main table
triggerCompaction, updateTableStatusForIndexTables -> table status write is happening without lock
[CARBONDATA-3881] Fix concurrent main table compaction and SI load issue
Consider a scenario, where segmentX has loaded to main table but failed to load to SI table. So, while loading another segmentY, we reload failed SI segmentX. this time if the segmentX is compacted in main table and clean files executed on it. SI load will fail and segment id will not be found in segmentMap of SI and it throws exception.

What changes were proposed in this PR?
for [CARBONDATA-3900]
release segment lock after main table is updated.
for [CARBONDATA-3882]
In updateLoadMetadataWithMergeStatus, take a lock on SI table
triggerCompaction, updateTableStatusForIndexTables -> add a lock for table status write
for [CARBONDATA-3881]
just before reloading the failed SI segment. check if it is valid segment in main table.

Does this PR introduce any user interface change?
No

Is any new testcase added?
No

This closes #3810
5 files changed
tree: 7695587b3e631a195de2705328cf933b0f2143c0
  1. .github/
  2. assembly/
  3. bin/
  4. build/
  5. common/
  6. conf/
  7. core/
  8. dev/
  9. docs/
  10. examples/
  11. format/
  12. geo/
  13. hadoop/
  14. index/
  15. integration/
  16. licenses-binary/
  17. mv/
  18. processing/
  19. python/
  20. sdk/
  21. streaming/
  22. tools/
  23. .gitignore
  24. LICENSE
  25. NOTICE
  26. pom.xml
  27. README.md
README.md

Apache CarbonData is an indexed columnar data store solution for fast analytics on big data platform, e.g.Apache Hadoop, Apache Spark, etc.

You can find the latest CarbonData document and learn more at: http://carbondata.apache.org

CarbonData cwiki

Visit count: HitCount

Status

Spark2.4: Build Status Coverage Status

Features

CarbonData file format is a columnar store in HDFS, it has many features that a modern columnar format has, such as splittable, compression schema ,complex data type etc, and CarbonData has following unique features:

  • Stores data along with index: it can significantly accelerate query performance and reduces the I/O scans and CPU resources, where there are filters in the query. CarbonData index consists of multiple level of indices, a processing framework can leverage this index to reduce the task it needs to schedule and process, and it can also do skip scan in more finer grain unit (called blocklet) in task side scanning instead of scanning the whole file.
  • Operable encoded data :Through supporting efficient compression and global encoding schemes, can query on compressed/encoded data, the data can be converted just before returning the results to the users, which is “late materialized”.
  • Supports for various use cases with one single Data format : like interactive OLAP-style query, Sequential Access (big scan), Random Access (narrow scan).

Building CarbonData

CarbonData is built using Apache Maven, to build CarbonData

Online Documentation

Experimental Features

Some features are marked as experimental because the syntax/implementation might change in the future.

  1. Hybrid format table using Add Segment.
  2. Accelerating performance using MV on parquet/orc.
  3. Merge API for Spark DataFrame.
  4. Hive write for non-transactional table.

Integration

Other Technical Material

Fork and Contribute

This is an active open source project for everyone, and we are always open to people who want to use this system or contribute to it. This guide document introduce how to contribute to CarbonData.

Contact us

To get involved in CarbonData:

About

Apache CarbonData is an open source project of The Apache Software Foundation (ASF).