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/09/29 14:02:12 UTC
[GitHub] [hudi] giftbowen opened a new pull request, #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
giftbowen opened a new pull request, #6830:
URL: https://github.com/apache/hudi/pull/6830
### Change Logs
Skip checking corrupt log blocks for transactional write file systems
### Impact
- The benchmark results show corrupted block check could be 100's of msecs for larger file sizes.
- This change would boost block read of 100's of ms per block.
**Risk level: low**
- Only turned on S3 and GCS for this feature, those for sure supports transactional write.
- For other file systems, there's no change.
### Documentation Update
It can be considered a small feature, probably worth mentioning that for cloud storage with transactional write support, there're certain optimization around it.
### Contributor's checklist
- [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Change Logs and Impact were stated clearly
- [ ] Adequate tests were added if applicable
- [ ] CI passed
--
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
[GitHub] [hudi] hudi-bot commented on pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #6830:
URL: https://github.com/apache/hudi/pull/6830#issuecomment-1403084872
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897",
"triggerID" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"triggerType" : "PUSH"
}, {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11917",
"triggerID" : "1263021647",
"triggerType" : "MANUAL"
}, {
"hash" : "4b13e187f9bf8ab53644ec93cc8e12eec122ce9c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14613",
"triggerID" : "4b13e187f9bf8ab53644ec93cc8e12eec122ce9c",
"triggerType" : "PUSH"
}, {
"hash" : "e4092aa1a724cf820113cef5223cfad011c53e26",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "e4092aa1a724cf820113cef5223cfad011c53e26",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4b13e187f9bf8ab53644ec93cc8e12eec122ce9c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14613)
* e4092aa1a724cf820113cef5223cfad011c53e26 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
[GitHub] [hudi] hudi-bot commented on pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #6830:
URL: https://github.com/apache/hudi/pull/6830#issuecomment-1403185385
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897",
"triggerID" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"triggerType" : "PUSH"
}, {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11917",
"triggerID" : "1263021647",
"triggerType" : "MANUAL"
}, {
"hash" : "4b13e187f9bf8ab53644ec93cc8e12eec122ce9c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14613",
"triggerID" : "4b13e187f9bf8ab53644ec93cc8e12eec122ce9c",
"triggerType" : "PUSH"
}, {
"hash" : "e4092aa1a724cf820113cef5223cfad011c53e26",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14621",
"triggerID" : "e4092aa1a724cf820113cef5223cfad011c53e26",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* e4092aa1a724cf820113cef5223cfad011c53e26 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14621)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
[GitHub] [hudi] hudi-bot commented on pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6830:
URL: https://github.com/apache/hudi/pull/6830#issuecomment-1263026890
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897",
"triggerID" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"triggerType" : "PUSH"
}, {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11917",
"triggerID" : "1263021647",
"triggerType" : "MANUAL"
} ]
}-->
## CI report:
* 6ab358154bb350a68340c9e8b9cafd0de260252c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897) Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11917)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
[GitHub] [hudi] hudi-bot commented on pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6830:
URL: https://github.com/apache/hudi/pull/6830#issuecomment-1262349895
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897",
"triggerID" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 6ab358154bb350a68340c9e8b9cafd0de260252c Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
[GitHub] [hudi] alexeykudinkin commented on a diff in pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by "alexeykudinkin (via GitHub)" <gi...@apache.org>.
alexeykudinkin commented on code in PR #6830:
URL: https://github.com/apache/hudi/pull/6830#discussion_r1086202983
##########
hudi-common/src/test/java/org/apache/hudi/common/functional/TestHoodieLogFormat.java:
##########
@@ -914,6 +917,34 @@ public void testAppendAndReadOnCorruptedLog() throws IOException, URISyntaxExcep
reader.close();
}
+ @Test
+ public void testSkipCorruptedCheck() throws Exception {
+ // normal case: if the block is corrupted, we should be able to read back a corrupted block
+ Reader reader1 = createCorruptedFile("test-fileid1");
+ HoodieLogBlock block = reader1.next();
+ assertEquals(HoodieLogBlockType.CORRUPT_BLOCK, block.getBlockType(), "The read block should be a corrupt block");
+ reader1.close();
+
+ // as we can't mock a private method or directly test it, we are going this route.
+ // So adding a corrupted block which ideally should have been skipped for write transactional system. and hence when we call next() on log block reader, it will fail.
+ Reader reader2 = createCorruptedFile("test-fileid2");
+ assertTrue(reader2.hasNext(), "We should have corrupted block next");
+
+ // mock the fs to be GCS to skip isBlockCorrupted() check
+ Field f1 = reader2.getClass().getDeclaredField("fs");
Review Comment:
We should rewrite this PR to use custom (mocked) FS w/ custom scheme, so that we don't need to call setAccessible (which is deprecated in JDK 17)
--
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
[GitHub] [hudi] hudi-bot commented on pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6830:
URL: https://github.com/apache/hudi/pull/6830#issuecomment-1262342522
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 6ab358154bb350a68340c9e8b9cafd0de260252c UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
[GitHub] [hudi] alexeykudinkin commented on a diff in pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by "alexeykudinkin (via GitHub)" <gi...@apache.org>.
alexeykudinkin commented on code in PR #6830:
URL: https://github.com/apache/hudi/pull/6830#discussion_r1086178778
##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFileReader.java:
##########
@@ -282,45 +285,50 @@ private HoodieLogBlock createCorruptBlock(long blockStartPos) throws IOException
}
private boolean isBlockCorrupted(int blocksize) throws IOException {
- long currentPos = inputStream.getPos();
- long blockSizeFromFooter;
+ if (!StorageSchemes.isWriteTransactional(fs.getScheme())) {
Review Comment:
Let's invert this conditional and return early instead to reduce amount of code we need to change
--
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
[GitHub] [hudi] hudi-bot commented on pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #6830:
URL: https://github.com/apache/hudi/pull/6830#issuecomment-1403088098
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897",
"triggerID" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"triggerType" : "PUSH"
}, {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11917",
"triggerID" : "1263021647",
"triggerType" : "MANUAL"
}, {
"hash" : "4b13e187f9bf8ab53644ec93cc8e12eec122ce9c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14613",
"triggerID" : "4b13e187f9bf8ab53644ec93cc8e12eec122ce9c",
"triggerType" : "PUSH"
}, {
"hash" : "e4092aa1a724cf820113cef5223cfad011c53e26",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14621",
"triggerID" : "e4092aa1a724cf820113cef5223cfad011c53e26",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4b13e187f9bf8ab53644ec93cc8e12eec122ce9c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14613)
* e4092aa1a724cf820113cef5223cfad011c53e26 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14621)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
[GitHub] [hudi] giftbowen commented on pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by GitBox <gi...@apache.org>.
giftbowen commented on PR #6830:
URL: https://github.com/apache/hudi/pull/6830#issuecomment-1263021647
@hudi-bot run azure
--
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
[GitHub] [hudi] hudi-bot commented on pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #6830:
URL: https://github.com/apache/hudi/pull/6830#issuecomment-1402846258
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897",
"triggerID" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"triggerType" : "PUSH"
}, {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11917",
"triggerID" : "1263021647",
"triggerType" : "MANUAL"
}, {
"hash" : "4b13e187f9bf8ab53644ec93cc8e12eec122ce9c",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14613",
"triggerID" : "4b13e187f9bf8ab53644ec93cc8e12eec122ce9c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 6ab358154bb350a68340c9e8b9cafd0de260252c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897) Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11917)
* 4b13e187f9bf8ab53644ec93cc8e12eec122ce9c Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14613)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
[GitHub] [hudi] hudi-bot commented on pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6830:
URL: https://github.com/apache/hudi/pull/6830#issuecomment-1263147762
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897",
"triggerID" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"triggerType" : "PUSH"
}, {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11917",
"triggerID" : "1263021647",
"triggerType" : "MANUAL"
} ]
}-->
## CI report:
* 6ab358154bb350a68340c9e8b9cafd0de260252c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897) Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11917)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
[GitHub] [hudi] nsivabalan commented on a diff in pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan commented on code in PR #6830:
URL: https://github.com/apache/hudi/pull/6830#discussion_r1086040536
##########
hudi-common/src/main/java/org/apache/hudi/common/fs/StorageSchemes.java:
##########
@@ -97,4 +104,12 @@ public static boolean isAppendSupported(String scheme) {
}
return Arrays.stream(StorageSchemes.values()).anyMatch(s -> s.supportsAppend() && s.scheme.equals(scheme));
}
+
+ public static boolean isWriteTransactional(String scheme) {
+ if (!isSchemeSupported(scheme)) {
+ throw new IllegalArgumentException("Unsupported scheme :" + scheme);
+ }
+
+ return Arrays.stream(StorageSchemes.values()).anyMatch(s -> s.isWriteTransactional() && s.scheme.equals(scheme));
Review Comment:
ENUM could be named differently than "scheme". and hence we are doing it this way. if its a single field ENUM, we could do that you are suggesting.
--
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
[GitHub] [hudi] codope commented on a diff in pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by "codope (via GitHub)" <gi...@apache.org>.
codope commented on code in PR #6830:
URL: https://github.com/apache/hudi/pull/6830#discussion_r1086212761
##########
hudi-common/src/test/java/org/apache/hudi/common/functional/TestHoodieLogFormat.java:
##########
@@ -914,6 +917,34 @@ public void testAppendAndReadOnCorruptedLog() throws IOException, URISyntaxExcep
reader.close();
}
+ @Test
+ public void testSkipCorruptedCheck() throws Exception {
+ // normal case: if the block is corrupted, we should be able to read back a corrupted block
+ Reader reader1 = createCorruptedFile("test-fileid1");
+ HoodieLogBlock block = reader1.next();
+ assertEquals(HoodieLogBlockType.CORRUPT_BLOCK, block.getBlockType(), "The read block should be a corrupt block");
+ reader1.close();
+
+ // as we can't mock a private method or directly test it, we are going this route.
+ // So adding a corrupted block which ideally should have been skipped for write transactional system. and hence when we call next() on log block reader, it will fail.
+ Reader reader2 = createCorruptedFile("test-fileid2");
+ assertTrue(reader2.hasNext(), "We should have corrupted block next");
+
+ // mock the fs to be GCS to skip isBlockCorrupted() check
+ Field f1 = reader2.getClass().getDeclaredField("fs");
Review Comment:
+1 HUDI-5614 for followup.
cc @giftbowen
--
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
[GitHub] [hudi] nsivabalan merged pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan merged PR #6830:
URL: https://github.com/apache/hudi/pull/6830
--
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
[GitHub] [hudi] hudi-bot commented on pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6830:
URL: https://github.com/apache/hudi/pull/6830#issuecomment-1262597620
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897",
"triggerID" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 6ab358154bb350a68340c9e8b9cafd0de260252c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
[GitHub] [hudi] alexeykudinkin commented on a diff in pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by GitBox <gi...@apache.org>.
alexeykudinkin commented on code in PR #6830:
URL: https://github.com/apache/hudi/pull/6830#discussion_r999867005
##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFileReader.java:
##########
@@ -160,12 +163,17 @@ private HoodieLogBlock readBlock() throws IOException {
return createCorruptBlock(blockStartPos);
}
- // We may have had a crash which could have written this block partially
- // Skip blockSize in the stream and we should either find a sync marker (start of the next
- // block) or EOF. If we did not find either of it, then this block is a corrupted block.
- boolean isCorrupted = isBlockCorrupted(blockSize);
- if (isCorrupted) {
- return createCorruptBlock(blockStartPos);
+ // Block is possibly corrupted only when write is not transactional
+ // the corrupted check could take 100's msec for larger file sizes, skipping the check for fs with transactional write
+ // see https://issues.apache.org/jira/browse/HUDI-2118
+ if (!StorageSchemes.isWriteTransactional(fs.getScheme())) {
Review Comment:
I'd suggest we fold this check into the `isBlockCorrupted` check itself:
- At the end of the day, this part of the same check
- We limit the scope of the change to just `isBlockCorrupted` method
##########
hudi-common/src/test/java/org/apache/hudi/common/functional/TestHoodieLogFormat.java:
##########
@@ -769,6 +772,36 @@ public void testAppendAndReadOnCorruptedLog() throws IOException, URISyntaxExcep
reader.close();
}
+ @Test
+ public void testSkipCorruptedCheck() throws Exception {
+ // normal case: if the block is corrupted, we should be able to read back a corrupted block
+ Reader reader1 = createCorruptedFile("test-fileid1");
+ HoodieLogBlock block = reader1.next();
+ assertEquals(HoodieLogBlockType.CORRUPT_BLOCK, block.getBlockType(), "The read block should be a corrupt block");
+ reader1.close();
+
+ // mock case: we want to verify that isBlockCorrupted() check is skipped for transactional write fs
+ // so here created a corrupted block for a transactional write fs(which would never happen) to verify the skip logic
+ // a better way to verify it is to mock the private method isBlockCorrupted(), but it is not available in current Mockito framework
+ // and the attempt to onboard powermock with private method mocking capability has failed
Review Comment:
We can omit the part regarding powermock, and just elaborate that we're doing this b/c we can't mock private method
##########
hudi-common/src/main/java/org/apache/hudi/common/fs/StorageSchemes.java:
##########
@@ -97,4 +104,12 @@ public static boolean isAppendSupported(String scheme) {
}
return Arrays.stream(StorageSchemes.values()).anyMatch(s -> s.supportsAppend() && s.scheme.equals(scheme));
}
+
+ public static boolean isWriteTransactional(String scheme) {
+ if (!isSchemeSupported(scheme)) {
+ throw new IllegalArgumentException("Unsupported scheme :" + scheme);
+ }
+
+ return Arrays.stream(StorageSchemes.values()).anyMatch(s -> s.isWriteTransactional() && s.scheme.equals(scheme));
Review Comment:
If we know that scheme is supported we can just do `Scheme.valueOf`
--
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
[GitHub] [hudi] hudi-bot commented on pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #6830:
URL: https://github.com/apache/hudi/pull/6830#issuecomment-1402841570
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897",
"triggerID" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"triggerType" : "PUSH"
}, {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11917",
"triggerID" : "1263021647",
"triggerType" : "MANUAL"
}, {
"hash" : "4b13e187f9bf8ab53644ec93cc8e12eec122ce9c",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "4b13e187f9bf8ab53644ec93cc8e12eec122ce9c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 6ab358154bb350a68340c9e8b9cafd0de260252c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897) Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11917)
* 4b13e187f9bf8ab53644ec93cc8e12eec122ce9c UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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
[GitHub] [hudi] hudi-bot commented on pull request #6830: [HUDI-2118] Skip checking corrupt log blocks for transactional write file systems
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #6830:
URL: https://github.com/apache/hudi/pull/6830#issuecomment-1403024849
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11897",
"triggerID" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"triggerType" : "PUSH"
}, {
"hash" : "6ab358154bb350a68340c9e8b9cafd0de260252c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11917",
"triggerID" : "1263021647",
"triggerType" : "MANUAL"
}, {
"hash" : "4b13e187f9bf8ab53644ec93cc8e12eec122ce9c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14613",
"triggerID" : "4b13e187f9bf8ab53644ec93cc8e12eec122ce9c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 4b13e187f9bf8ab53644ec93cc8e12eec122ce9c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=14613)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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