ParquetFileWriter in invalid state after network outage in end(metadata)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- java
- Lĩnh vực
- data-engineering
Hướng nghiên cứu
Bắt đầu với parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java và kiểm tra các chuyển đổi trạng thái xung quanh end(metadata) cùng các thao tác bị lỗi. Tái hiện lỗi bằng TestParquetWriter.testParquetWriterWithFailingIO và theo dõi trạng thái ENDED được báo cáo. Công việc được hoàn tất khi một lần tải lên thất bại không khiến writer ở trạng thái không hợp lệ khi close được thử lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug, including details regarding any error messages, version, and platform.
Related to apache/iceberg#13508, possibly to #1971,
We're using parquet-java 1.15.2 as part of iceberg, uploading data to S3. The data is flushed to storage in configurable intervals.
Description
If a short network interruption happens exactly while writing and uploading files, the ParquetFileWriter is already transitioned into the state ENDED, even though the file has not been written successfully.
Another call to close the (iceberg-) writer results in an exception of the ParquetFileWriter, being in an invalid state.
Stacktrace:
java.io.UncheckedIOException: Failed to flush row group
at org.apache.iceberg.parquet.ParquetWriter.flushRowGroup(ParquetWriter.java:225)
at org.apache.iceberg.parquet.ParquetWriter.close(ParquetWriter.java:257)
at org.apache.iceberg.io.DataWriter.close(DataWriter.java:82)
at org.apache.iceberg.io.RollingFileWriter.closeCurrentWriter(RollingFileWriter.java:126)
at org.apache.iceberg.io.RollingFileWriter.close(RollingFileWriter.java:156)
at org.apache.iceberg.io.RollingDataWriter.close(RollingDataWriter.java:32)
at org.apache.iceberg.io.FanoutWriter.closeWriters(FanoutWriter.java:82)
at org.apache.iceberg.io.FanoutWriter.close(FanoutWriter.java:74)
at org.apache.iceberg.io.FanoutDataWriter.close(FanoutDataWriter.java:31)
at org.apache.iceberg.parquet.TestParquetWriter.testParquetWriterWithFailingIO(TestParquetWriter.java:113)
[... Junit/JDK classes ...]
Caused by: java.io.IOException: The file being written is in an invalid state. Probably caused by an error thrown previously. Current state: ENDED
at org.apache.parquet.hadoop.ParquetFileWriter$STATE.error(ParquetFileWriter.java:250)
at org.apache.parquet.hadoop.ParquetFileWriter$STATE.startBlock(ParquetFileWriter.java:224)
at org.apache.parquet.hadoop.ParquetFileWriter.startBlock(ParquetFileWriter.java:586)
at org.apache.iceberg.parquet.ParquetWriter.flushRowGroup(ParquetWriter.java:215)
... 100 more
Possible Solution
Every time the internal field state is updated, it is done in the very beginning of a method, which is too early. If later in the method's code an exception is thrown, not all logic has been executed successfully, leaving the writer in an invalid state.
But simply moving the transition in state to the end of the method could result in executing the code multiple times, if a retry-mechanism calls the method multiple times - that must also be avoided.
One possibility would be to introduce more internal states. This would allow to track the state of the writer in more detail, which again makes it more resilient to retries.
Component(s)
Core
- Ngôn ngữ chính
- Java
- Star
- 3.1k
- Fork
- 1.6k
- Merge trung bình
- 6 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 36
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/parquet-java
-
Type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
apache/parquet-java#3792 ·
-
Make PageReader AutoCloseable Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/parquet-java#3767 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/parquet-java#3695 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/parquet-java#3667 ·
-
Type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/parquet-java#3587 ·
Tất cả issue của apache/parquet-java
Issue tương tự
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
inu-appcenter/memorIN-backend#288 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
frontend maui-pilot pilot-ask question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Đang mởarea/plugin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
kestra-io/plugin-kestra#190 ·