Caideyipi opened a new pull request, #18853: URL: https://github.com/apache/iotdb/pull/18853
## Description A DataNode can keep rejecting new Thrift connections after a large-frame burst or leader failover because long-lived connections retain oversized RPC buffers. Requests at or below the initial buffer capacity never enter the normal shrink path, including the shrink requested by `flush()`. Once the shared pool is full, allocating even the initial 1 KB buffer fails repeatedly across RPC services. This change allows small frames to participate in gradual shrinking, with the initial capacity as the lower bound. When allocation fails, the memory manager reclaims oversized buffers whose frames have been fully consumed or sent and retries immediately. Candidates belong to the same memory control and are held through a weak registry. Nonblocking buffer locks prevent concurrent allocations from waiting on each other's buffers; unread frames and unflushed writes remain protected. The same lifecycle covers compression buffers. Failed transport opens also close their allocated buffers. This prevents reconnect attempts from leaking quota when a client constructor fails before the caller can obtain the transport. Allocation failures now include the pool's total, used, and available bytes, with matching English and Chinese diagnostics. ## Validation - `mvn test -pl iotdb-client/service-rpc`: **107 tests passed**, including a local Thrift server accepting a new connection while an old connection retains large-frame buffers. - Regression coverage for small-frame shrinking, pressure recovery, unread/unflushed payload integrity, Snappy scratch buffers, concurrent allocation, memory-control ownership, failed reconnect cleanup, and pool diagnostics. - Full-reactor English and Chinese `test-compile` with tests skipped. - Formatting, Checkstyle, locale key/format parity, and inline diagnostic checks. The original three-DataNode failover workload has not been rerun with this patch. This PR has: - [x] been self-reviewed, including concurrent allocation and reclamation. - [x] updated buffer policy documentation and comments explaining frame ownership and lock ordering. - [x] added regression tests for the new paths and preserved rejection when only active buffers occupy the pool. -- 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]
