remove unnecessary code in super version getter (#11452)
Summary: Do not bother comparing the version of the local super version handle with the global one. An inequality comparison result indicates nothing but a spurious obsoleteness. It only happens when the writer has increased the `ColumnFamilyData::super_version_number_`(oxigraph-main5fc57eec2b/db/column_family.cc (L1309)
) but has not yet called `ResetThreadLocalSuperVersions()`(5fc57eec2b/db/column_family.cc (L1328)
) at the time when a reader reads the local handle(`void* ptr = local_sv_->Swap(SuperVersion::kSVInUse);`). In other words, the existence of a local handle is a sufficent evidence of its fressness. With this PR, we save one or even two atomic instructions when getting a handle of super version. Pull Request resolved: https://github.com/facebook/rocksdb/pull/11452 Reviewed By: ajkr Differential Revision: D46059317 Pulled By: cbi42 fbshipit-source-id: 68b4b1ca8a9929a4aa470105c37a09e0625b014d
parent
bf9e864235
commit
28bf7ba77d
Loading…
Reference in new issue