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

use DBBackend set at compile time #3792

Merged
merged 3 commits into from
Mar 4, 2019
Merged

Conversation

alessio
Copy link
Contributor

@alessio alessio commented Mar 4, 2019

Replace NewGoLevelDB() with generic NewLevelDB() calls.
DB backend is picked according to build time configuration.

Makefile:

  • DB backend can be switched at compile time by
    adding WITH_CLEVELDB=yes to make install.
  • Add support for user supplied ldflags and build tags.

Closes: #3719

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote tests
  • Updated relevant documentation (docs/)
  • Added entries in PENDING.md with issue #
  • rereviewed Files changed in the github PR explorer

For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented Mar 4, 2019

Codecov Report

Merging #3792 into develop will decrease coverage by 0.03%.
The diff coverage is 7.14%.

@@             Coverage Diff             @@
##           develop    #3792      +/-   ##
===========================================
- Coverage       61%   60.97%   -0.04%     
===========================================
  Files          191      191              
  Lines        14174    14182       +8     
===========================================
  Hits          8647     8647              
- Misses        4973     4981       +8     
  Partials       554      554

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs PENDING.md, a question about error handling.

Also, benchmarks would be interesting.

types/utils.go Show resolved Hide resolved
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestedACK. Needs a pending log entry. Also, I don't see why we should be supporting user defined ldflags? This should be only used internally by the makefile as I cannot see a circumstance where these would need to be overwritten? Do you have an example?

EDIT: Also, CI needs a kick.

@@ -40,6 +40,9 @@ tags.

### SDK

* [\#3719](https://github.com/cosmos/cosmos-sdk/issues/3719) DBBackend can now be set at compile time.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cwgoes @alexanderbez pending line is here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@alessio
Copy link
Contributor Author

alessio commented Mar 4, 2019

@alexanderbez dixit:

This should be only used internally by the makefile as I cannot see a circumstance where these would need to be overwritten?

They wouldn't be overwritten, but appended. Same goes for build tags.

@cwgoes
Copy link
Contributor

cwgoes commented Mar 4, 2019

Also, I don't see why we should be supporting user defined ldflags?

Users might want custom build options - it seems unlikely that they would define custom build flags by accident - is there a reason not to give them the option?

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@alexanderbez
Copy link
Contributor

@alessio @cwgoes build tags, yes, users should hav the ability to control. ldflags, not so much. Usually these tie to some internal compilation state, not sure why users would or should modify these.

@alessio
Copy link
Contributor Author

alessio commented Mar 4, 2019

@alexanderbez is it a blocker then? Traditionally, open source programs' build systems allow user to override {C,{,XX,PP}LD}FLAGS. I think that allowing users to customise their build does not do any harm

@cwgoes cwgoes merged commit 3e82a8b into develop Mar 4, 2019
@cwgoes cwgoes deleted the alessio/3719-leveldb-driver branch March 4, 2019 20:31
@ackratos
Copy link
Contributor

without this change does previous level db performance test result still hold...? Would it possible your previous performance test run against goleveldb...

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.

4 participants