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

Fix/replace transaction #1192

Merged
merged 19 commits into from
Aug 7, 2023
Merged

Fix/replace transaction #1192

merged 19 commits into from
Aug 7, 2023

Conversation

dabasov
Copy link
Member

@dabasov dabasov commented Aug 2, 2023

Changes

Fixes

Tests

Tasks to complete before merging PR:

  • Ensure system tests are passing. If not Run them manually to check for any regressions 📋
  • Do any new system tests need added to test this change? do any existing system tests need updated? If so create a PR at 0chain/system_test
  • Merge your system tests PR to master AFTER merging this PR

Associated PRs (Link as appropriate):

  • 0chain:
  • gosdk:
  • system_test:
  • zboxcli:
  • zwalletcli:
  • Other: ...

@service-0chain
Copy link
Collaborator

Manual system tests [cancelled] with the following config

config value
tests skipped false
system-tests
gosdk NOT OVERRIDDEN
zboxcli
zwalletcli
0chain
blobber fix/replace-transaction
authorizer
0box
0dns

@codecov-commenter
Copy link

codecov-commenter commented Aug 3, 2023

Codecov Report

Merging #1192 (8075e1f) into sprint-july-4 (b0d46cf) will increase coverage by 0.06%.
The diff coverage is 16.79%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@                Coverage Diff                @@
##           sprint-july-4    #1192      +/-   ##
=================================================
+ Coverage          25.46%   25.52%   +0.06%     
=================================================
  Files                 81       81              
  Lines               9170     9136      -34     
=================================================
- Hits                2335     2332       -3     
+ Misses              6544     6514      -30     
+ Partials             291      290       -1     
Flag Coverage Δ
Unit-Tests 25.52% <16.79%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...ain.net/blobbercore/allocation/allocationchange.go 0.00% <0.00%> (ø)
code/go/0chain.net/blobbercore/allocation/dao.go 0.00% <0.00%> (ø)
.../0chain.net/blobbercore/allocation/newdirchange.go 0.00% <0.00%> (ø)
...de/go/0chain.net/blobbercore/allocation/workers.go 0.00% <0.00%> (ø)
code/go/0chain.net/blobbercore/allocation/zcn.go 0.00% <0.00%> (ø)
...et/blobbercore/handler/object_operation_handler.go 18.70% <0.00%> (ø)
code/go/0chain.net/blobbercore/handler/protocol.go 0.00% <0.00%> (ø)
...de/go/0chain.net/blobbercore/reference/playlist.go 0.00% <0.00%> (ø)
.../0chain.net/blobbercore/reference/referencepath.go 0.00% <0.00%> (ø)
.../go/0chain.net/blobbercore/writemarker/protocol.go 0.00% <0.00%> (ø)
... and 7 more

@dabasov dabasov changed the base branch from staging to sprint-july-4 August 3, 2023 11:32
@service-0chain
Copy link
Collaborator

Manual system tests [failure] with the following config

config value
tests skipped false
system-tests
gosdk NOT OVERRIDDEN
zboxcli
zwalletcli
0chain
blobber fix/replace-transaction
authorizer
0box
0dns

Comment on lines +88 to +91
//conn := ctx.Value(ContextKeyTransaction)
//if conn != nil {
// return ctx
//}

Choose a reason for hiding this comment

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

should we remove this section? I see this causing confusions later.

Copy link
Member Author

Choose a reason for hiding this comment

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

for sure

tx.Commit()
return nil
}
func (store *postgresStore) WithTransaction(ctx context.Context, f func(ctx context.Context) error) error {
Copy link

@sunilmhta sunilmhta Aug 5, 2023

Choose a reason for hiding this comment

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

I do not see its usage anywhere? Is this method on the store required ?

Copy link
Member Author

Choose a reason for hiding this comment

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

we need it, it will be used eventually

Comment on lines +34 to +35
WithNewTransaction(f func(ctx context.Context) error) error
WithTransaction(ctx context.Context, f func(ctx context.Context) error) error

Choose a reason for hiding this comment

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

What is the difference between these two methods? And I do not see any usage of the WithTransaction method. Did I not check it properly? If it indeed do not have any usage, is it really required then?

Copy link
Member Author

Choose a reason for hiding this comment

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

they are different actually
WithNewTransaction(f func(ctx context.Context) error) error will force create new transaction and new context
WithTransaction(ctx context.Context, f func(ctx context.Context) error) error will use existent transaction or will create the new one in given context

@dabasov dabasov merged commit 3a1a405 into sprint-july-4 Aug 7, 2023
6 of 7 checks passed
@dabasov dabasov deleted the fix/replace-transaction branch August 7, 2023 07:59
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.

6 participants