maedhroz commented on code in PR #3700:
URL: https://github.com/apache/cassandra/pull/3700#discussion_r2427530138
##########
src/java/org/apache/cassandra/index/SecondaryIndexManager.java:
##########
@@ -918,14 +920,21 @@ public void indexPartition(DecoratedKey key, Set<Index>
indexes, int pageSize, R
SinglePartitionPager pager = new SinglePartitionPager(cmd, null,
ProtocolVersion.CURRENT);
while (!pager.isExhausted())
{
+ UnfilteredRowIterator partition;
try (ReadExecutionController controller =
cmd.executionController();
- WriteContext ctx =
keyspace.getWriteHandler().createContextForIndexing();
UnfilteredPartitionIterator page =
pager.fetchPageUnfiltered(baseCfs.metadata(), pageSize, controller))
{
if (!page.hasNext())
break;
- try (UnfilteredRowIterator partition = page.next())
+ try (UnfilteredRowIterator onePartition = page.next())
+ {
+ partition =
ImmutableBTreePartition.create(onePartition).unfilteredIterator();
+ }
+ }
+
+ try (WriteContext ctx =
keyspace.getWriteHandler().createContextForIndexing())
Review Comment:
At the end of this `try` block, you might want to add:
```
finally
{
if (partition != null)
partition.close();
}
```
--
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]