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

Request transfer transactions in parallel #125

Merged
merged 5 commits into from
Apr 22, 2024
Merged

Conversation

yito88
Copy link
Member

@yito88 yito88 commented Apr 13, 2024

Description

Each worker's ScalarDB transaction service requested transactions one by one though there are multiple workers.
This PR changes the transaction request to execute multiple transactions at once.
We can test concurrent transactions in more practical cases, especially for the group commit.

Related issues and/or PRs

If this PR addresses or references any issues and/or other PRs, list them here.

Changes made

  • Generate multiple transfers with transfer
  • Set max-num-txs to request transactions at once
  • Execute transactions in parallel in a worker
  • Modify the checkers to confirm the number of succeeded transactions

Checklist

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

Provide any additional information or notes that may be relevant to the reviewers or stakeholders.

@yito88 yito88 marked this pull request as ready for review April 14, 2024 21:03
@@ -9,7 +9,8 @@
[org.slf4j/slf4j-jdk14 "2.0.6"]
[cassandra "0.1.0-SNAPSHOT"]
[cheshire "5.12.0"]
[com.scalar-labs/scalardb-schema-loader "4.0.0-SNAPSHOT"]]
[com.scalar-labs/scalardb-schema-loader "4.0.0-SNAPSHOT"
:exclusions [org.slf4j/*]]]
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for taking care of the issue!

Copy link
Member Author

Choose a reason for hiding this comment

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

It was fixed by scalar-labs/scalardb#1665.
Reverted.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see. Understood.

[test op transfer-fn]
(let [results (pmap #(transfer-fn test %) (:value op))]
(if (some #{:commit} results)
;; return :ok when at least 1 transaction is committed
Copy link
Contributor

Choose a reason for hiding this comment

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

:ok needs to be returned for this filtering even if only one transaction is committed?

Copy link
Member Author

@yito88 yito88 Apr 15, 2024

Choose a reason for hiding this comment

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

Right, it's just for the checker, Jepsen requires the type though

Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

Copy link
Contributor

@brfrn169 brfrn169 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@feeblefakie feeblefakie merged commit 06f9b5e into master Apr 22, 2024
3 checks passed
@feeblefakie feeblefakie deleted the feature/more-txs branch April 22, 2024 08:48
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