Caideyipi opened a new pull request, #18668:
URL: https://github.com/apache/iotdb/pull/18668

   ## Description
   
   A stale DataNode heartbeat response may contain quota usage for only 
databases known when the heartbeat was sent. Replacing the entire usage map 
with that response can remove usage initialized by a concurrent `SET SPACE 
QUOTA`, leaving a visible quota limit without a corresponding usage entry and 
causing a null dereference during quota checks.
   
   This backports the relevant fix from #13291 to `dev/1.3`:
   
   - Store quota limits and usage in concurrent maps.
   - Initialize a database's usage before publishing its quota limit.
   - Merge heartbeat usage with `putAll` so a stale snapshot cannot remove 
newly initialized entries.
   - Add a regression test covering a stale heartbeat received after setting 
quota for a new database.
   
   ## Testing
   
   ```text
   mvn -o -pl iotdb-core/datanode -Dtest=DataNodeSpaceQuotaManagerTest 
-Dcheckstyle.skip=true -Dspotless.check.skip=true -Drat.skip=true 
-Ddevelocity.off=true test
   Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
   BUILD SUCCESS
   ```
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
       - [x] concurrent read and write
   - [x] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for code coverage.


-- 
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]

Reply via email to