Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
refactor client tracking, fix atomicity, squashing and multi/exec #2970
base: main
Are you sure you want to change the base?
refactor client tracking, fix atomicity, squashing and multi/exec #2970
Changes from 5 commits
4c3ceff
76444b3
7a54288
8390b04
db25d6d
5c8b215
40e2eaa
94c0866
7dc5565
49ce6b6
6c45d9b
b9e2103
c13961d
d760ed5
f9b13f2
6e604d7
a8360da
34304ac
4e33d72
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need to remove
const
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That;s for squashing :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you access conn_state, don't make it a function on conn_cntx
then you can just use conn_state, you can make it mutable or add a new member like
conn
dragonfly/src/server/main_service.cc
Lines 214 to 215 in a95419b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems that what you really want is to know if you are in the middle of EXEC execution and not multi.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We store so much fragile info that needs to be updated everywhere... seqnums would solve all this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, found it, yes that's also left 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
99.9% it does not affect us and it's not a bug. I created this #3034 for @romange to confirm and I will push a quick fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function now is called within the Shard. We have a convention to name it as
xxxOnShard
to stress it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: There is IsActive() so you don't need GetActiveShards()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: UdatePrevAndLastCommand name describes the implementation of this function. What it does is advancing the state. So I think it's better call it Tick or Advance or Update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename
prev_command_
totrack_current_cmd_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename:
executing_command_
totrack_next_cmd_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the
track_next_cmd_
seems misleading since it implies it's the next command.executing_command_
is the command wecurrently execute in InvokeCmd flow
andprev_command_
is the command before it. So:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment on whether we can keep this in conn_state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in most cases
client_tracking_map_
is empty but find still does all the computations including the hash value to return negative results. I suggest to guard this with.empty()
check to save some cycles here