Skip to content

Commit

Permalink
fix(rocksdb): correctly resolve rocksdb path (#1767) (backport #1776) (
Browse files Browse the repository at this point in the history
…#1777)

* fix(rocksdb): correctly resolve rocksdb path (#1767) (#1776)

* fix(rocksdb): correctly resolve rocksdb path (#1767)

ensure we use KAVA_HOME/data/application.db and not a nested
application.db within that path

* update changelog

---------

Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
(cherry picked from commit aca738f)

# Conflicts:
#	CHANGELOG.md

* update changelog

---------

Co-authored-by: Robert Pirtle <Astropirtle@gmail.com>
  • Loading branch information
mergify[bot] and pirtleshell authored Nov 20, 2023
1 parent ae3e0f3 commit aae2ff8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

- (metrics) [#1668] Adds non-state breaking x/metrics module for custom telemetry.
- (metrics) [#1669] Add performance timing metrics to all Begin/EndBlockers
- (rocksdb) [#1767] Fix resolution of rocksdb database path

## [v0.17.3](https://github.com/Kava-Labs/kava/releases/tag/v0.17.3)

Expand Down Expand Up @@ -166,5 +167,6 @@ Bump tendermint version to 0.32.10 to address [cosmos security advisory Lavender

[\#257](https://github.com/Kava-Labs/kava/pulls/257) Include scripts to run large-scale simulations remotely using aws-batch

[#1767]: https://github.com/Kava-Labs/kava/pull/1767
[#1669]: https://github.com/Kava-Labs/kava/pull/1669
[#1668]: https://github.com/Kava-Labs/kava/pull/1668
5 changes: 3 additions & 2 deletions cmd/kava/opendb/opendb_rocksdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const (
func OpenDB(appOpts types.AppOptions, home string, backendType dbm.BackendType) (dbm.DB, error) {
dataDir := filepath.Join(home, "data")
if backendType == dbm.RocksDBBackend {
return openRocksdb(filepath.Join(dataDir, "application.db"), appOpts)
return openRocksdb(dataDir, appOpts)
}

return dbm.NewDB("application", backendType, dataDir)
Expand All @@ -90,7 +90,8 @@ func OpenDB(appOpts types.AppOptions, home string, backendType dbm.BackendType)
// openRocksdb loads existing options, overrides some of them with appOpts and opens database
// option will be overridden only in case if it explicitly specified in appOpts
func openRocksdb(dir string, appOpts types.AppOptions) (dbm.DB, error) {
dbOpts, cfOpts, err := loadLatestOptions(dir)
optionsPath := filepath.Join(dir, "application.db")
dbOpts, cfOpts, err := loadLatestOptions(optionsPath)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit aae2ff8

Please sign in to comment.