wgtmac commented on code in PR #36192:
URL: https://github.com/apache/arrow/pull/36192#discussion_r1241369271


##########
cpp/src/parquet/file_reader.cc:
##########
@@ -351,8 +364,11 @@ class SerializedFile : public ParquetFileReader::Contents {
     cached_source_ =
         std::make_shared<::arrow::io::internal::ReadRangeCache>(source_, ctx, 
options);
     std::vector<::arrow::io::ReadRange> ranges;
+    prebuffered_column_chunks_.clear();

Review Comment:
   After double check, I think there could be concurrent issues. If `PreBuffer` 
and `GetRowGroup` can be called concurrently, `cached_source_` and 
`prebuffered_column_chunks_` might be in an inconsistent state. For example, 
`GetRowGroup` reads an old state in `prebuffered_column_chunks_`, then 
`PreBuffer` creates brand new `cached_source_` and 
`prebuffered_column_chunks_`. After that, `GetRowGroup` may pass the new 
`cached_source_` to the RowGroupReader. I believe the followup read will get an 
error complaining `Status::Invalid("ReadRangeCache did not find matching cache 
entry")`.
   
   cc @westonpace 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to