JackieTien97 commented on code in PR #16959:
URL: https://github.com/apache/iotdb/pull/16959#discussion_r2650074325
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java:
##########
@@ -319,6 +321,13 @@ protected void set(int index, long timestamp, int
valueIndex) {
int offset = i * ARRAY_SIZE;
Arrays.setAll(indices.get(i), j -> offset + j);
}
+ // Reserve memory for indices if the TVList is owned by a query
+ if (ownerQuery != null) {
+ long indicesBytes = indices.size() * PrimitiveArrayManager.ARRAY_SIZE
* 4L;
+ MemoryReservationManager memoryReservationManager =
+ ((FragmentInstanceContext)
ownerQuery).getMemoryReservationContext();
+ memoryReservationManager.reserveMemoryCumulatively(indicesBytes);
+ }
Review Comment:
1. if we need to lock this tvlist?
2. what if reserveMemoryCumulatively failed?(especially sort is called by
flush other than query)
--
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]