-
Notifications
You must be signed in to change notification settings - Fork 911
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
Specify readerID on loading history tasks #3994
Conversation
HasNext(readerID int32) bool | ||
Next(readerID int32) (tasks.Task, error) |
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.
I want iterators to be able to freely move between slices & queue readers, instead of bind to a specific slice or reader. Existing implementation is also based on that idea.
So readerID here can be regarded as a context for loading operations. The iterator implementation knows that if readerID changes, a new underlying pagingIterator is needed for talking to persistence.
184a5cb
to
723ce47
Compare
723ce47
to
3149281
Compare
@@ -257,6 +258,7 @@ func (r *dlqHandlerImpl) readMessagesWithAckLevel( | |||
GetHistoryTasksRequest: persistence.GetHistoryTasksRequest{ | |||
ShardID: r.shard.GetShardID(), | |||
TaskCategory: tasks.CategoryReplication, | |||
ReaderID: common.DefaultQueueReaderID, |
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 field probably doesn't make sense for replication DLQ.
I may later refactor the code so that GetReplicationDLQTaskRequest no longer embeds GetHistoryTasksRequest. May also do it for those dlq requests, haven't decided yet. We can sync later.
Not a problem right now cause persistence impl won't look at this field.
cc @yux0
What changed?
Why?
* The base of the PR contains History task reader persistence hint API #3986 so that review is easier, will update base after that PR is landed.How did you test it?
Potential risks
Is hotfix candidate?
no