wernerdv commented on code in PR #13554:
URL: https://github.com/apache/ignite/pull/13554#discussion_r4004698906
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/RowStore.java:
##########
@@ -132,8 +133,25 @@ public void addRow(CacheDataRow row, IoStatisticsHolder
statHolder) throws Ignit
* @param statHolder Statistics holder to track IO operations.
* @throws IgniteCheckedException If failed.
*/
- public void addRows(Collection<? extends CacheDataRow> rows,
- IoStatisticsHolder statHolder) throws IgniteCheckedException {
+ public void addRows(Collection<? extends CacheDataRow> rows,
IoStatisticsHolder statHolder) throws IgniteCheckedException {
+ if (!persistenceEnabled &&
grp.dataRegion().config().getPageEvictionMode() !=
DataPageEvictionMode.DISABLED) {
+ // Size-aware reserve for each row in the batch (reserving only
the largest is insufficient: a later large
+ // row can still exhaust page memory mid-write). The
reserve/consume TOCTOU race and the "second large row
+ // in a batch" case are both closed by the lazy re-reserve in
AbstractFreeList#writeSinglePage, which
+ // re-runs the reserve on the row remainder when a fragmented
write cannot take a page (a raw OOM there
+ // would otherwise be wrapped by insertDataRows into
CorruptedFreeListException and reported as corruption).
+ //
+ // The reserve evicts non-blockingly even though the batch path
holds no entry locks (so blocking would be
+ // deadlock-safe and more effective here): the same reserve path
is shared with single-row insertion,
+ // which runs under an entry lock and must not block.
+ for (CacheDataRow row : rows) {
+ int rowSize = row.size();
+
+ if (rowSize > 0)
Review Comment:
The check was unnecessary.
--
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]