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
[CARBONDATA-3920]Fix compaction failure issue for SI table and metadata mismatch in concurrency #3854
Conversation
Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/3439/ |
Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/1697/ |
Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/1729/ |
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/3471/ |
var mainTableLocked = false | ||
var indexTableLocked = false | ||
try { | ||
mainTableLocked = mainTableStatusLock.lockWithRetries() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If unable to get lock during the concurrent scenario, better to throw an exception to retry clean files command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since its a clean files, no need to throw exception, it can retry next time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Atleast add an error log of unable to get lock, so that the user will know that something happened and need to retry.
User tries multiple times in concurrent scenario and it won't clean due to lock issue. He will never know why it is not cleaned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
detail.setSegmentStatus(segToStatusMap(detail.getLoadName)) | ||
detail.setVisibility("false") | ||
} | ||
indexTableStatusLock.unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release the lock after updating the SI table status. now it is released before. It can impact concurrent scenarios
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
detail.setSegmentStatus(segToStatusMap(detail.getLoadName)) | ||
detail.setVisibility("false") | ||
} | ||
CarbonInternalLoaderUtil.recordLoadMetadata( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail as it will try to acquire lock and we didn't release.
here we need to call directly writeLoadDetailsIntoFile
, as we already have a lock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/3483/ |
Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/1741/ |
Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/1743/ |
Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/3485/ |
@ajantha-bhat please review and merge |
LGTM |
Why is this PR needed?
What changes were proposed in this PR?
Does this PR introduce any user interface change?
Is any new testcase added?