-
Notifications
You must be signed in to change notification settings - Fork 294
feat: add db migration/patch tool #1908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
08ac08a
add dbmigrate cmd
JayT106 eadb759
extend migration to cover cometBFT db
JayT106 880faaa
add flushing of rocksdb to sst files when migrating to rocksdb
randy-cro aa547e5
add databases flag
JayT106 36dcbf7
extend db migrate with designated height
JayT106 47be3ba
update docs
JayT106 261e1b1
patch feature supports dryrun and key conflict actions
JayT106 6b4f5de
fix missing txhash patch in tx_index.db
JayT106 d8145d0
fix missing ethereumTX event key patch
JayT106 e61a6ed
fix patch ethereumTx event data and add tests
JayT106 ebadce3
fix rebase conflict
JayT106 0930026
lint-fix
JayT106 17df335
remove unneed script, refine code
JayT106 9d63f42
fix code by coderabbit review and remove memdb pebbledb support
JayT106 17e07d0
nit
JayT106 ac14b1e
fix error and nit
JayT106 8f468cb
fix rocksdb open issue
JayT106 f7e1e5c
fix coderabbit check
JayT106 a79b1a8
fix conflict
JayT106 364c348
fix code base on coderabbit review
JayT106 b7cf325
fix code base on coderabbit review
JayT106 f92ad03
lint
JayT106 55a154d
fix potential panic
JayT106 c9d4b88
fix CI errors
JayT106 851bf7b
fix code by coderabbit's suggestion
JayT106 490318b
fix cronos keeper iter not close
JayT106 4c9ed51
Apply golangci-lint formatting fixes
JayT106 e5511cd
Update cmd/cronosd/cmd/patch_db.go
JayT106 1ea7b81
fix potential missing patch keys
JayT106 1186664
remove unneed function
JayT106 a047c1a
fix iterator walk issue and remove height filter support logic in db …
JayT106 be32c45
missing file commit
JayT106 f648787
fix print error
JayT106 ab25fc8
fix by code review
JayT106 9804ab1
refine log
JayT106 2cf2131
refactor patchTxIndexData and update cmd description
JayT106 52e0832
revert linting changes unrelate to this PR
JayT106 4f649b4
revert iter fix unrelated to this PR
JayT106 6316445
fix readme errors
JayT106 00f9d08
update readme
JayT106 22924f3
fix README markdown
JayT106 57ed23a
constraint BackendType and DBType
JayT106 da80731
rebase migrate db
JayT106 9bcec8c
patchdb path validation
JayT106 ef6c026
fix-lint
JayT106 39a9d05
fix target path not checking
JayT106 668d3df
add enhanced tests
JayT106 fc1402d
remove duplicated changelog
JayT106 8e37e3a
fix suggestions from coderabbit
JayT106 291e2cc
fix doc
JayT106 750c6c7
Merge branch 'main' into jt/dbmigrate
JayT106 ccfb715
Merge branch 'main' into jt/dbmigrate
JayT106 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package cmd | ||
|
|
||
| import ( | ||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| // DatabaseCmd returns the database command with subcommands | ||
| func DatabaseCmd() *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "database", | ||
| Short: "Database management commands", | ||
| Long: `Commands for managing Cronos databases. | ||
|
|
||
| Available subcommands: | ||
| migrate - Migrate databases between different backend types | ||
|
thomas-nguy marked this conversation as resolved.
|
||
| patch - Patch specific block heights into existing databases | ||
|
|
||
| Use "cronosd database [command] --help" for more information about a command.`, | ||
| Aliases: []string{"db"}, | ||
| } | ||
|
|
||
| // Add subcommands | ||
| cmd.AddCommand( | ||
| MigrateCmd(), | ||
| PatchCmd(), | ||
| ) | ||
|
|
||
| return cmd | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.