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: forbid parallel save operations #2172

Merged
merged 18 commits into from
Nov 21, 2023
Merged

Conversation

BorysTheDev
Copy link
Contributor

Copy link
Contributor

@dranikpg dranikpg left a comment

Choose a reason for hiding this comment

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

I like the approach. Please double check which state switches rely on the final state (regardless of switch) and which rely solely on the switch (I assume it's even only the one in the issue)... If the regression tests pass it should be close to correct 😆

src/server/server_family.cc Outdated Show resolved Hide resolved
src/server/replica.cc Outdated Show resolved Hide resolved
src/server/detail/save_stages_controller.cc Outdated Show resolved Hide resolved
@adiholden
Copy link
Collaborator

please add a regression test that issues 2 save commands at the same time and make sure one of them is rejected

src/server/dflycmd.cc Outdated Show resolved Hide resolved
dranikpg
dranikpg previously approved these changes Nov 15, 2023
tests/dragonfly/replication_test.py Outdated Show resolved Hide resolved
adiholden
adiholden previously approved these changes Nov 20, 2023
src/server/dflycmd.cc Outdated Show resolved Hide resolved
src/server/dflycmd.cc Outdated Show resolved Hide resolved
src/server/dflycmd.cc Outdated Show resolved Hide resolved
src/server/dflycmd.cc Outdated Show resolved Hide resolved
@@ -1685,7 +1685,7 @@ async def test_network_disconnect_small_buffer(df_local_factory, df_seeder_facto
# Df is blazingly fast, so by the time we tick a second time on
# line 1674, DF already replicated all the data so the assertion
# at the end of the test will always fail
fill_task = asyncio.create_task(seeder.run())
fill_task = asyncio.create_task(seeder.run(target_ops=40000000))
Copy link
Collaborator

Choose a reason for hiding this comment

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

why did you add target_ops?
The flow of the test should be seeder run until we call below seeder.stop()

What was failing that caused you to change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the test failed on the build machine, but locally everything was correct. So according to comments I've increased target_ops

Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment was written in this PR https://github.com/dragonflydb/dragonfly/pull/1970/files and I believe its not relevant now as we dont use target ops. We need to find why this failed but for now please remove this change.

@BorysTheDev BorysTheDev merged commit e6f3522 into main Nov 21, 2023
10 checks passed
@BorysTheDev BorysTheDev deleted the parallelSaveOperationsFix branch November 21, 2023 11:56
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.

None yet

4 participants