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

[db] Fix variadic interface bug #3568

Merged
merged 3 commits into from
Jul 21, 2022
Merged

Conversation

Liuhaai
Copy link
Member

@Liuhaai Liuhaai commented Jul 20, 2022

Description

Fixes #3517

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Code refactor or improvement
  • [] Breaking change (fix or feature that would cause a new or changed behavior of existing functionality)
  • [] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [] make test
  • [] fullsync
  • [] Other test (please specify)

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • [] My code follows the style guidelines of this project
  • [] I have performed a self-review of my code
  • [] I have commented my code, particularly in hard-to-understand areas
  • [] I have made corresponding changes to the documentation
  • [] My changes generate no new warnings
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] New and existing unit tests pass locally with my changes
  • [] Any dependent changes have been merged and published in downstream modules

@Liuhaai Liuhaai requested a review from a team as a code owner July 20, 2022 21:59
@codecov
Copy link

codecov bot commented Jul 20, 2022

Codecov Report

Merging #3568 (7bdcc90) into master (a20e489) will decrease coverage by 1.34%.
The diff coverage is 54.11%.

❗ Current head 7bdcc90 differs from pull request most recent head 4e03431. Consider uploading reports for the commit 4e03431 to get more accurate results

@@            Coverage Diff             @@
##           master    #3568      +/-   ##
==========================================
- Coverage   75.43%   74.09%   -1.35%     
==========================================
  Files         247      254       +7     
  Lines       22845    23379     +534     
==========================================
+ Hits        17233    17322      +89     
- Misses       4685     5132     +447     
+ Partials      927      925       -2     
Impacted Files Coverage Δ
action/protocol/staking/read_state.go 15.38% <0.00%> (ø)
api/grpcserver.go 79.49% <ø> (+0.55%) ⬆️
blockchain/blockchain.go 0.89% <0.00%> (ø)
blockchain/filedao/filedao_legacy.go 85.80% <ø> (ø)
blockchain/filedao/filedao_v2.go 98.51% <ø> (ø)
blockchain/pubsubmanager.go 0.00% <0.00%> (ø)
config/config.go 94.06% <ø> (+9.31%) ⬆️
consensus/scheme/rolldpos/rolldposctx.go 73.47% <0.00%> (-0.18%) ⬇️
db/db_bolt.go 72.51% <ø> (-0.19%) ⬇️
db/kvstore_impl.go 61.64% <ø> (ø)
... and 64 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

@@ -270,7 +270,7 @@ func (cb *cachedBatch) Delete(namespace string, key []byte, errorFormat string,
h := cb.hash(namespace, key)
cb.touchKey(h)
cb.currentCache().Evict(&h)
cb.kvStoreBatch.batch(Delete, namespace, key, nil, errorFormat, errorArgs)
cb.kvStoreBatch.batch(Delete, namespace, key, nil, errorFormat, errorArgs...)
Copy link
Member

Choose a reason for hiding this comment

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

this is prob not the complete fix, need to also change errorArgs to []interface{}, and use errorArgs... when it is used in WriteBatch
see 010f0d0 (also not complete, just demo the fix on baseKVStoreBatch)

@Liuhaai Liuhaai merged commit 78bdacd into iotexproject:master Jul 21, 2022
dustinxie pushed a commit that referenced this pull request Oct 5, 2022
* fix variadic interface bug

* replace errorFormat with errorMessage
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.

maybe a bug in batch_impl.go, not expect behavior with Wrapf(e, errFmt, errArgs)
3 participants