Skip to content

[Remote Compaction] Simulate e2e flow in Stress Test#13800

Closed
jaykorean wants to merge 6 commits intofacebook:mainfrom
jaykorean:remote_compaction_stress_test_
Closed

[Remote Compaction] Simulate e2e flow in Stress Test#13800
jaykorean wants to merge 6 commits intofacebook:mainfrom
jaykorean:remote_compaction_stress_test_

Conversation

@jaykorean
Copy link
Contributor

@jaykorean jaykorean commented Jul 23, 2025

Summary

Simulate Remote Compaction in Stress Test by running a separate set of threads that runs remote compaction.
Queue and ResultMap for the remote compactions are stored in memory as part of the SharedState. They are shared across main worker threads and remote compaction worker threads.

enable_remote_compaction is replaced by remote_compaction_worker_threads.
If remote_compaction_worker_threads is set to 0, remote compaction is not enabled in Stress Test.

To Follow up

This PR covers happy path only. Failure injection in the remote worker thread will be added as a follow up.

Test Plan

./db_stress --remote_compaction_worker_threads=4  --flush_one_in=1000 --writepercent=40 --readpercent=40 --iterpercent=10 --prefixpercent=0 --delpercent=10 --destroy_db_initially=0 --clear_column_family_one_in=0 --reopen=0
python3 -u tools/db_crashtest.py blackbox --remote_compaction_worker_threads=8

@jaykorean jaykorean requested a review from hx235 July 24, 2025 01:18
@jaykorean jaykorean marked this pull request as ready for review July 24, 2025 01:18
@jaykorean jaykorean changed the title [Remote Compaction] Simulate e2e flow in Stress Test (Happy Path Only) [Remote Compaction] Simulate e2e flow in Stress Test Jul 24, 2025
@facebook-github-bot
Copy link
Contributor

@jaykorean has imported this pull request. If you are a Meta employee, you can view this in D78862084.

@jaykorean jaykorean force-pushed the remote_compaction_stress_test_ branch from cda4e1f to 74062eb Compare July 24, 2025 20:45
@facebook-github-bot
Copy link
Contributor

@jaykorean has imported this pull request. If you are a Meta employee, you can view this in D78862084.

Comment on lines +38 to +46
FLAGS_remote_compaction_wait_timeout) {
if (shared_->GetRemoteCompactionResult(scheduled_job_id, result).ok()) {
return CompactionServiceJobStatus::kSuccess;
}
Env::Default()->SleepForMicroseconds(
FLAGS_remote_compaction_wait_interval);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you find yourself having to tune FLAGS_remote_compaction_wait_interval and FLAGS_remote_compaction_wait_timeout? Otherwise I feel like they can be hard-coded. Similar to FLAGS_remote_compaction_worker_interval.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FLAGS_remote_compaction_worker_interval -> We may tune this in the near future

FLAGS_remote_compaction_wait_interval and FLAGS_remote_compaction_wait_timeout -> I think these two can be hardcoded.

Copy link
Contributor

@hx235 hx235 left a comment

Choose a reason for hiding this comment

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

LGTM - just make sure to fix the CI stress test failure and monitor future failures in the near future.

@jaykorean jaykorean force-pushed the remote_compaction_stress_test_ branch 3 times, most recently from 4a2f2a9 to b8124af Compare July 27, 2025 22:18
@jaykorean jaykorean force-pushed the remote_compaction_stress_test_ branch 3 times, most recently from af6e5bf to c0b8275 Compare July 27, 2025 23:38
@jaykorean jaykorean force-pushed the remote_compaction_stress_test_ branch from c0b8275 to 844b1ea Compare July 28, 2025 03:57
@facebook-github-bot
Copy link
Contributor

@jaykorean has imported this pull request. If you are a Meta employee, you can view this in D78862084.

@facebook-github-bot
Copy link
Contributor

@jaykorean merged this pull request in 217e075.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants