Skip to content
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

[FAB-18191] Remove contents of leveldb dir instead of the dir itself when dropping dbs #1828

Merged
merged 1 commit into from
Sep 2, 2020

Conversation

wenjianqiao
Copy link
Contributor

@wenjianqiao wenjianqiao commented Sep 1, 2020

Signed-off-by: Wenjian Qiao wenjianq@gmail.com

Type of change

  • Improvement

Description

When dropping a leveldb, remove all contents of the directory instead of the directory itself.

Additional details

This is common code for upgrade-dbs, rebuild, reset, and rollback. It does not impact ledger rebuild function. The change is requested because some leveldb directories (e.g., StateLevelDB) may be mounted and therefore cannot be deleted.

Related issues

https://jira.hyperledger.org/browse/FAB-18191

@wenjianqiao wenjianqiao requested a review from a team as a code owner September 1, 2020 13:54
@wenjianqiao
Copy link
Contributor Author

/ci-run

@github-actions
Copy link

github-actions bot commented Sep 1, 2020

AZP build triggered!

@wenjianqiao
Copy link
Contributor Author

/ci-run

@github-actions
Copy link

github-actions bot commented Sep 1, 2020

AZP build triggered!

internal/fileutil/fileutil.go Show resolved Hide resolved
internal/fileutil/fileutil_test.go Outdated Show resolved Hide resolved
core/ledger/kvledger/tests/env.go Outdated Show resolved Hide resolved
…when dropping dbs

When dropping a leveldb, remove all contents of the directory instead of
the directory itself. This is common code for upgrade-dbs, rebuild, reset, and rollback.

Signed-off-by: Wenjian Qiao <wenjianq@gmail.com>
@wenjianqiao
Copy link
Contributor Author

/ci-run

@github-actions
Copy link

github-actions bot commented Sep 2, 2020

AZP build triggered!

@manish-sethi manish-sethi merged commit adb5884 into hyperledger:master Sep 2, 2020
@lindluni
Copy link
Contributor

lindluni commented Sep 2, 2020

@Mergifyio backport release-2.2

@mergify
Copy link

mergify bot commented Sep 2, 2020

Command backport release-2.2: failure

No backport have been created

  • Backport to branch release-2.2 failed

Cherry-pick of adb5884 has failed:

On branch mergify/bp/release-2.2/pr-1828
Your branch is up to date with 'origin/release-2.2'.

You are currently cherry-picking commit adb588403.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:

	modified:   common/ledger/blkstorage/reset.go
	modified:   core/ledger/kvledger/drop_dbs.go
	modified:   core/ledger/kvledger/rebuild_dbs_test.go
	modified:   core/ledger/kvledger/tests/rebuild_test.go
	modified:   core/ledger/kvledger/tests/reset_test.go
	modified:   core/ledger/kvledger/tests/rollback_test.go
	modified:   core/ledger/kvledger/tests/v1x_test.go

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)

	both modified:   core/ledger/kvledger/tests/env.go
	deleted by us:   internal/fileutil/fileutil.go
	deleted by us:   internal/fileutil/fileutil_test.go
	both modified:   internal/peer/node/rebuild_dbs_test.go
	both modified:   internal/peer/node/reset_test.go

denyeart pushed a commit that referenced this pull request Sep 2, 2020
…when dropping dbs (#1828)

When dropping a leveldb, remove all contents of the directory instead of
the directory itself. This is common code for upgrade-dbs, rebuild, reset, and rollback.

Signed-off-by: Wenjian Qiao <wenjianq@gmail.com>
@wenjianqiao wenjianqiao deleted the fab18191 branch October 9, 2020 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants