You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/06/23 18:00:23 UTC

[GitHub] [hudi] nsivabalan commented on a diff in pull request #5945: [HUDI-4308] READ_OPTIMIZED read mode will temporary loss of data when compaction

nsivabalan commented on code in PR #5945:
URL: https://github.com/apache/hudi/pull/5945#discussion_r905314925


##########
hudi-common/src/main/java/org/apache/hudi/BaseHoodieTableFileIndex.java:
##########
@@ -279,7 +279,8 @@ private void doRefresh() {
 
     validate(activeTimeline, queryInstant);
 
-    if (tableType.equals(HoodieTableType.MERGE_ON_READ) && queryType.equals(HoodieTableQueryType.SNAPSHOT)) {
+    if (tableType.equals(HoodieTableType.MERGE_ON_READ) && queryType.equals(HoodieTableQueryType.SNAPSHOT)
+        || (queryType.equals(HoodieTableQueryType.READ_OPTIMIZED))) {

Review Comment:
   within the "if" block, we call `fileSystemView.getLatestMergedFileSlicesBeforeOrOn` which is applicable only for SNAPSHOT. for read optimized, it may not make sense since we are interested only in base files. "else" block rightly uses `fileSystemView.getLatestFileSlicesBeforeOrOn`.
   can you help understand the issue you are facing. 



##########
hudi-common/src/main/java/org/apache/hudi/BaseHoodieTableFileIndex.java:
##########
@@ -279,7 +279,8 @@ private void doRefresh() {
 
     validate(activeTimeline, queryInstant);
 
-    if (tableType.equals(HoodieTableType.MERGE_ON_READ) && queryType.equals(HoodieTableQueryType.SNAPSHOT)) {
+    if (tableType.equals(HoodieTableType.MERGE_ON_READ) && queryType.equals(HoodieTableQueryType.SNAPSHOT)
+        || (queryType.equals(HoodieTableQueryType.READ_OPTIMIZED))) {

Review Comment:
   also, can we write a test case to reproduce the bug and showcase that w/o the fix it fails and w/ the fix, it succeeds



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org