anishshri-db opened a new pull request, #40770:
URL: https://github.com/apache/spark/pull/40770

   ### What changes were proposed in this pull request?
   Add support for tracking pinned blocks memory usage for RocksDB state store
   
   ### Why are the changes needed?
   Today we only track total memory usage for RocksDB that comprises of write 
buffer, block cache and index/filter blocks. Its also useful to understand 
usage of blocks pinned in the cache, potentially due to iterators not releasing 
them. 
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   Modified unit tests
   
   ```
   [info] Run completed in 11 seconds, 964 milliseconds.
   [info] Total number of tests run: 5
   [info] Suites: completed 1, aborted 0
   [info] Tests: succeeded 5, failed 0, canceled 0, ignored 0, pending 0
   [info] All tests passed.
   ```
   
   Also, verified that the metrics appear in the custom metrics for state store:
   
   ```
       "customMetrics" : {
         "rocksdbBytesCopied" : 1189,
         "rocksdbCommitCheckpointLatency" : 14,
         "rocksdbCommitCompactLatency" : 0,
         "rocksdbCommitFileSyncLatencyMs" : 150,
         "rocksdbCommitFlushLatency" : 15,
         "rocksdbCommitPauseLatency" : 0,
         "rocksdbCommitWriteBatchLatency" : 4,
         "rocksdbFilesCopied" : 1,
         "rocksdbFilesReused" : 0,
         "rocksdbGetCount" : 6,
         "rocksdbGetLatency" : 0,
         "rocksdbPinnedBlocksMemoryUsage" : 87,
         "rocksdbPutCount" : 1,
         "rocksdbPutLatency" : 4,
         "rocksdbReadBlockCacheHitCount" : 0,
         "rocksdbReadBlockCacheMissCount" : 0,
         "rocksdbSstFileSize" : 1189,
         "rocksdbTotalBytesRead" : 0,
         "rocksdbTotalBytesReadByCompaction" : 0,
         "rocksdbTotalBytesReadThroughIterator" : 0,
         "rocksdbTotalBytesWritten" : 123,
         "rocksdbTotalBytesWrittenByCompaction" : 0,
         "rocksdbTotalBytesWrittenByFlush" : 1325,
         "rocksdbTotalCompactionLatencyMs" : 0,
         "rocksdbWriterStallLatencyMs" : 0,
         "rocksdbZipFileBytesUncompressed" : 7283
       }
   ```
   


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

Reply via email to