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

Proto definition for multi cursor queue persistence states #3035

Merged
merged 3 commits into from
Jun 29, 2022

Conversation

yycptt
Copy link
Member

@yycptt yycptt commented Jun 29, 2022

What changed?

  • Proto definition for multi cursor queue persistence states

Why?

  • For checkpointing multi cursor queue processing progress

How did you test it?

  • N/A, only adding definition

Potential risks

  • N/A, not used

Is hotfix candidate?

  • No.

@yycptt yycptt requested a review from wxing1292 June 29, 2022 18:58
@yycptt yycptt requested a review from a team as a code owner June 29, 2022 18:58

message QueueState {
map<int32, QueueReaderState> reader_states = 1;
int64 exclusive_max_read_key = 2;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the boundary of read & write zone. Needed since the slice with the highest max key can be completed and removed before other slices. Or there can be no slices at all if the process for all pending slices are completed.

Copy link
Contributor

Choose a reason for hiding this comment

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

should this be a struct (not int64, e.g. timer)
and can you find a better name

Copy link
Member Author

Choose a reason for hiding this comment

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

I can define a separate struct for task key and persist both the fire time and the taskID (and use it in QueueSliceRange as well).

But since the actual read/delete persistence api only supports querying either time or taskID, persisting one value seems sufficient to me. Let me know.

I tried.. naming is so hard, maybe readerHighWatermark? Any suggestions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Defined new taskKey message and used it here and in QueueSliceRange.

Renamed the field to exclusive_reader_high_watermark.

Comment on lines 42 to 46
message AllPredicateAttributes {
}

message EmptyPredicateAttributes {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

All vs None? Full vs Empty?

Copy link
Member Author

Choose a reason for hiding this comment

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

I used to call them All/None. But later I found "Empty set" is a math term so I renamed to that. The term for All is universal, which is not that intuitive so didn't change to that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed All -> Universal, so that they corresponds to Universal and Empty set in math.

@yycptt yycptt merged commit d09213a into temporalio:master Jun 29, 2022
@yycptt yycptt deleted the queue-persistence-proto branch June 29, 2022 21:49
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.

2 participants