klsince commented on code in PR #9797:
URL: https://github.com/apache/pinot/pull/9797#discussion_r1025862341
##########
pinot-core/src/main/java/org/apache/pinot/core/segment/processing/framework/SegmentProcessorFramework.java:
##########
@@ -142,28 +142,31 @@ public List<File> process()
for (Map.Entry<String, GenericRowFileManager> entry :
partitionToFileManagerMap.entrySet()) {
String partitionId = entry.getKey();
GenericRowFileManager fileManager = entry.getValue();
- GenericRowFileReader fileReader = fileManager.getFileReader();
- int numRows = fileReader.getNumRows();
- int numSortFields = fileReader.getNumSortFields();
- LOGGER.info("Start creating segments on partition: {}, numRows: {},
numSortFields: {}", partitionId, numRows,
- numSortFields);
- GenericRowFileRecordReader recordReader = fileReader.getRecordReader();
- for (int startRowId = 0; startRowId < numRows; startRowId +=
maxNumRecordsPerSegment, sequenceId++) {
- int endRowId = Math.min(startRowId + maxNumRecordsPerSegment, numRows);
- LOGGER.info("Start creating segment of sequenceId: {} with row range:
{} to {}", sequenceId, startRowId,
- endRowId);
- observer.accept(String.format(
- "Creating segment of sequentId: %d with data from partition: %s
and row range: [%d, %d) out of [0, %d)",
- sequenceId, partitionId, startRowId, endRowId, numRows));
- generatorConfig.setSequenceId(sequenceId);
- GenericRowFileRecordReader recordReaderForRange =
recordReader.getRecordReaderForRange(startRowId, endRowId);
- SegmentIndexCreationDriverImpl driver = new
SegmentIndexCreationDriverImpl();
- driver.init(generatorConfig, new
RecordReaderSegmentCreationDataSource(recordReaderForRange),
- TransformPipeline.getPassThroughPipeline());
- driver.build();
- outputSegmentDirs.add(driver.getOutputDirectory());
+ try {
+ GenericRowFileReader fileReader = fileManager.getFileReader();
+ int numRows = fileReader.getNumRows();
+ int numSortFields = fileReader.getNumSortFields();
+ LOGGER.info("Start creating segments on partition: {}, numRows: {},
numSortFields: {}", partitionId, numRows,
+ numSortFields);
+ GenericRowFileRecordReader recordReader = fileReader.getRecordReader();
+ for (int startRowId = 0; startRowId < numRows; startRowId +=
maxNumRecordsPerSegment, sequenceId++) {
+ int endRowId = Math.min(startRowId + maxNumRecordsPerSegment,
numRows);
+ LOGGER.info("Start creating segment of sequenceId: {} with row
range: {} to {}", sequenceId, startRowId,
+ endRowId);
+ observer.accept(String.format(
+ "Creating segment of sequentId: %d with data from partition: %s
and row range: [%d, %d) out of [0, %d)",
+ sequenceId, partitionId, startRowId, endRowId, numRows));
+ generatorConfig.setSequenceId(sequenceId);
+ GenericRowFileRecordReader recordReaderForRange =
recordReader.getRecordReaderForRange(startRowId, endRowId);
+ SegmentIndexCreationDriverImpl driver = new
SegmentIndexCreationDriverImpl();
+ driver.init(generatorConfig, new
RecordReaderSegmentCreationDataSource(recordReaderForRange),
+ TransformPipeline.getPassThroughPipeline());
+ driver.build();
+ outputSegmentDirs.add(driver.getOutputDirectory());
+ }
+ } finally {
+ fileManager.cleanUp();
Review Comment:
_mapperOutputDir and _reducerOutputDir are internal to this framework, so
the caller can't check their existence. And when the issue happened, the files
were deleted (file names were gone from the file system). But as it's still
opened by the process via mmap, so the file (inode, disk space) was not
released cleanly.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]