baomingyu opened a new issue, #17268:
URL: https://github.com/apache/pulsar/issues/17268
### Motivation
In the exclusive consumption mode of exclusive, failover, reader, etc. if a
large number of messages accumulate due to limited consumption capacity or
consumption logic problems, expanding partitions or modifying consumption logic
cannot reduce the consumption of new messages in time. Influence, a certain
proportion of newly added messages will still be produced in the accumulated
paritition, and new messages cannot be quickly consumed by restarted consumers
or new consumers. In this way, the time affected by the accumulation factor may
very long.
In order to reduce the impact on the business, through the control of read
and write permissions, configure some partitions as read-only, so that newly
produced messages can be sent to the partitions with less accumulation or newly
expanded, reducing the impact on the business caused by the accumulation of
messages. Reduce the overall time-consuming of production--consumption.
### Goal
Add read and write control for a single partition
### API Changes
1、PB protocl
message CommandPartitionedTopicMetadataResponse {
enum LookupType {
Success = 0;
Failed = 1;
}
optional uint32 partitions = 1; // Optional in case of error
required uint64 request_id = 2;
optional LookupType response = 3;
optional ServerError error = 4;
optional string message = 5;
repeated KeyValue metadata = 6;// key parition index,value:r、w、rw
}
2、Modify choosePartition method in all implement class of MessageRouter, and
it will not choose read-only partition to send msg.
3、ProducerImpl adds permission attributes, and if permission is read-only
will not be used sending msg.
4、Modify admin interface updatePartitionedTopic to update metadata of topic
### Implementation
1、PB protocl
message CommandPartitionedTopicMetadataResponse {
enum LookupType {
Success = 0;
Failed = 1;
}
optional uint32 partitions = 1; // Optional in case of error
required uint64 request_id = 2;
optional LookupType response = 3;
optional ServerError error = 4;
optional string message = 5;
repeated KeyValue metadata = 6;// key parition index,value:r、w、rw
}
2、Modify choosePartition method in all implement class of MessageRouter, and
it will not choose read-only partition to send msg.
3、ProducerImpl adds permission attributes, and if permission is read-only
will not be used sending msg.
4、Modify admin interface updatePartitionedTopic to update metadata of topic
### Alternatives
_No response_
### Anything else?
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]