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

[pipeline] switch from broadcast channel to shared future #15453

Merged
merged 1 commit into from
Dec 3, 2024
Merged

Conversation

zekun000
Copy link
Contributor

@zekun000 zekun000 commented Dec 2, 2024

The use case we have here is probably more suitable for a shared future with oneshot channel than a broadcast channel.
Broadcast channel has a property of dropping values if exceeds the capacity and receiver will see a RecvError::Lagged error. Using oneshot channel we can do exact once send easily and use shared future to share the result to multiple subscribers.

Description

How Has This Been Tested?

Key Areas to Review

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other (specify)

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Dec 2, 2024

@zekun000 zekun000 requested review from danielxiangzl, ibalajiarun and msmouse and removed request for ibalajiarun and sasha8 December 2, 2024 23:21
@@ -79,7 +79,7 @@ impl StatelessPipeline for ExecutionSchedulePhase {
for b in &ordered_blocks {
if let Some(tx) = b.pipeline_tx().lock().as_mut() {
tx.rand_tx.take().map(|tx| tx.send(b.randomness().cloned()));
let _ = tx.order_proof_tx.send(());
tx.order_proof_tx.take().map(|tx| tx.send(()));
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we expect (assert) take() to return Some?

same all other places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably later, I had a few places that may retry in observer prototype

@zekun000 zekun000 enabled auto-merge (rebase) December 3, 2024 00:47

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Dec 3, 2024

✅ Forge suite realistic_env_max_load success on dc120a8dcb008cec26190a70d1baa1c20f481ef6

two traffics test: inner traffic : committed: 13990.50 txn/s, latency: 2840.36 ms, (p50: 2700 ms, p70: 2700, p90: 3000 ms, p99: 3700 ms), latency samples: 5319500
two traffics test : committed: 100.07 txn/s, latency: 2260.79 ms, (p50: 1900 ms, p70: 2100, p90: 2400 ms, p99: 20500 ms), latency samples: 1720
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 1.923, avg: 1.267", "ConsensusProposalToOrdered: max: 0.311, avg: 0.293", "ConsensusOrderedToCommit: max: 0.379, avg: 0.367", "ConsensusProposalToCommit: max: 0.673, avg: 0.660"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.81s no progress at version 38978 (avg 0.20s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 15.70s no progress at version 2770490 (avg 15.70s) [limit 16].
Test Ok

Copy link
Contributor

github-actions bot commented Dec 3, 2024

✅ Forge suite framework_upgrade success on 010570d3b7aa20889fb5ad0e5b23800aa33f5634 ==> dc120a8dcb008cec26190a70d1baa1c20f481ef6

Compatibility test results for 010570d3b7aa20889fb5ad0e5b23800aa33f5634 ==> dc120a8dcb008cec26190a70d1baa1c20f481ef6 (PR)
Upgrade the nodes to version: dc120a8dcb008cec26190a70d1baa1c20f481ef6
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1393.09 txn/s, submitted: 1395.62 txn/s, failed submission: 2.53 txn/s, expired: 2.53 txn/s, latency: 2270.39 ms, (p50: 2100 ms, p70: 2400, p90: 3600 ms, p99: 5100 ms), latency samples: 121020
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1332.95 txn/s, submitted: 1334.81 txn/s, failed submission: 1.86 txn/s, expired: 1.86 txn/s, latency: 2383.32 ms, (p50: 2100 ms, p70: 2700, p90: 3900 ms, p99: 5600 ms), latency samples: 114900
5. check swarm health
Compatibility test for 010570d3b7aa20889fb5ad0e5b23800aa33f5634 ==> dc120a8dcb008cec26190a70d1baa1c20f481ef6 passed
Upgrade the remaining nodes to version: dc120a8dcb008cec26190a70d1baa1c20f481ef6
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1425.01 txn/s, submitted: 1428.48 txn/s, failed submission: 3.47 txn/s, expired: 3.47 txn/s, latency: 2299.44 ms, (p50: 2100 ms, p70: 2500, p90: 3600 ms, p99: 5100 ms), latency samples: 123320
Test Ok

Copy link
Contributor

github-actions bot commented Dec 3, 2024

✅ Forge suite compat success on 010570d3b7aa20889fb5ad0e5b23800aa33f5634 ==> dc120a8dcb008cec26190a70d1baa1c20f481ef6

Compatibility test results for 010570d3b7aa20889fb5ad0e5b23800aa33f5634 ==> dc120a8dcb008cec26190a70d1baa1c20f481ef6 (PR)
1. Check liveness of validators at old version: 010570d3b7aa20889fb5ad0e5b23800aa33f5634
compatibility::simple-validator-upgrade::liveness-check : committed: 13724.31 txn/s, latency: 2502.18 ms, (p50: 2100 ms, p70: 2300, p90: 2700 ms, p99: 7900 ms), latency samples: 498560
2. Upgrading first Validator to new version: dc120a8dcb008cec26190a70d1baa1c20f481ef6
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 6783.08 txn/s, latency: 4099.10 ms, (p50: 4700 ms, p70: 5100, p90: 5400 ms, p99: 5800 ms), latency samples: 119000
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 6795.61 txn/s, latency: 4731.69 ms, (p50: 5000 ms, p70: 5200, p90: 6800 ms, p99: 7000 ms), latency samples: 223780
3. Upgrading rest of first batch to new version: dc120a8dcb008cec26190a70d1baa1c20f481ef6
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 4572.34 txn/s, latency: 6497.76 ms, (p50: 7100 ms, p70: 7700, p90: 8100 ms, p99: 8300 ms), latency samples: 94960
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 4512.05 txn/s, latency: 7282.33 ms, (p50: 7700 ms, p70: 8100, p90: 8600 ms, p99: 9500 ms), latency samples: 157280
4. upgrading second batch to new version: dc120a8dcb008cec26190a70d1baa1c20f481ef6
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 10680.37 txn/s, latency: 2618.80 ms, (p50: 2700 ms, p70: 3000, p90: 3500 ms, p99: 3800 ms), latency samples: 187600
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 11223.46 txn/s, latency: 2832.49 ms, (p50: 2700 ms, p70: 3100, p90: 3300 ms, p99: 3500 ms), latency samples: 364900
5. check swarm health
Compatibility test for 010570d3b7aa20889fb5ad0e5b23800aa33f5634 ==> dc120a8dcb008cec26190a70d1baa1c20f481ef6 passed
Test Ok

@zekun000 zekun000 merged commit 1b0fb83 into main Dec 3, 2024
94 checks passed
@zekun000 zekun000 deleted the zekun/tokio branch December 3, 2024 01:20
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