Fix stale memory access with FSBuffer and tiered sec cache by anand1976 · Pull Request #12712 · facebook/rocksdb (original) (raw)

@anand1976

@anand1976 anand1976 changed the titleFix stale memory access with tiered sec cache and FSBuffer Fix stale memory access with FSBuffer and tiered sec cache

May 29, 2024

jaykorean

@anand1976

jaykorean

@anand1976

@anand1976

@anand1976

jaykorean

anand1976 added a commit that referenced this pull request

May 31, 2024

@anand1976

Summary: A BlockBasedTable with TieredSecondaryCache containing a NVM cache inserts blocks into the compressed cache and the corresponding compressed block into the NVM cache. The BlockFetcher is used to get the uncompressed and compressed blocks by calling ReadBlockContents() and GetUncompressedBlock() respectively. If the file system supports FSBuffer (i.e returning a FS allocated buffer rather than caller provided), that buffer gets freed between the two calls. This PR fixes it by making the FSBuffer unique pointer a member rather than local variable.

Pull Request resolved: #12712

Test Plan:

  1. Add a unit test
  2. Release validation stress test

Reviewed By: jaykorean

Differential Revision: D57974026

Pulled By: anand1976

fbshipit-source-id: cfa895914e74b4f628413b40e6e39d8d8e5286bd

ajkr pushed a commit that referenced this pull request

Jun 2, 2024

@anand1976 @ajkr

Summary: A BlockBasedTable with TieredSecondaryCache containing a NVM cache inserts blocks into the compressed cache and the corresponding compressed block into the NVM cache. The BlockFetcher is used to get the uncompressed and compressed blocks by calling ReadBlockContents() and GetUncompressedBlock() respectively. If the file system supports FSBuffer (i.e returning a FS allocated buffer rather than caller provided), that buffer gets freed between the two calls. This PR fixes it by making the FSBuffer unique pointer a member rather than local variable.

Pull Request resolved: #12712

Test Plan:

  1. Add a unit test
  2. Release validation stress test

Reviewed By: jaykorean

Differential Revision: D57974026

Pulled By: anand1976

fbshipit-source-id: cfa895914e74b4f628413b40e6e39d8d8e5286bd

ybtsdst pushed a commit to ybtsdst/rocksdb that referenced this pull request

Apr 27, 2025

@anand1976

…12712)

Summary: A BlockBasedTable with TieredSecondaryCache containing a NVM cache inserts blocks into the compressed cache and the corresponding compressed block into the NVM cache. The BlockFetcher is used to get the uncompressed and compressed blocks by calling ReadBlockContents() and GetUncompressedBlock() respectively. If the file system supports FSBuffer (i.e returning a FS allocated buffer rather than caller provided), that buffer gets freed between the two calls. This PR fixes it by making the FSBuffer unique pointer a member rather than local variable.

Pull Request resolved: facebook#12712

Test Plan:

  1. Add a unit test
  2. Release validation stress test

Reviewed By: jaykorean

Differential Revision: D57974026

Pulled By: anand1976

fbshipit-source-id: cfa895914e74b4f628413b40e6e39d8d8e5286bd

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})