jvarenina commented on a change in pull request #6036:
URL: https://github.com/apache/geode/pull/6036#discussion_r604226126
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/wan/InternalGatewaySender.java
##########
@@ -46,7 +46,7 @@
void destroy(boolean initiator);
- void setStartEventProcessorInPausedState();
+ void setStartEventProcessorInPausedState(boolean isPaused);
Review comment:
Hi @gesterzhou ,
Thank you very much for the comment!
The state parameter is persisted within cluster configuration on locator at
the reception of gfsh commands that update the state of gateway-sender (create,
pause, stop and start gateway-sender commands). When member restarts and joins
the cluster, then it will receive cluster configuration containing the latest
value of state parameter, and will start gateway-sender accordingly. So this
means that only locators will have the latest gateway-sender state that is
configured with gfsh commands, and servers will have the state which was used
at startup of server and gateway-sender creation.
The flag `setStartEventProcessorInPausedState` was actually used by`
async-event-queue `code for following cases:
1. list async-event-queues command -> the flag is used to determine
`Created with paused event processing` parameter value in printout:
```
Member | ID | Batch Size | Persistent | Disk Store | Max Memory |
Listener | Created with paused event
processing | Currently Paused
-------- | ------ | ---------- | ---------- | ---------- | ---------- |
-------------------------------------------------------- |
------------------------------------ | ----------------
server-1 | queue1 | 100 | false | null | 100 |
org.apache.geode.internal.cache.wan.MyAsyncEventListener | false
| false
server-2 | queue2 | 100 | false | null | 100 |
org.apache.geode.internal.cache.wan.MyAsyncEventListener | false
| false
```
2. When gateway-sender (used by async-event-queue) is started using
interface GatewaySender.start() then this flag is checked, and if set, then
gateway-sender is started in paused state.
In this PR, I have reused the "setStartEventProcessorInPausedState()" just
to start gateway-sender in paused state as described in step 2. I have also
reset the flag right after gateway-sender is started in paused state, so that
this flag doesn't interfere with future start commands. This case is explained
in commit message on following link
https://github.com/apache/geode/pull/6036/commits/29afa4476c379a53d79f6919ad92b6314601040b
Not sure that I fully understood your request. Do you maybe propose that we
change this flag `setStartEventProcessorInPausedState(bolean)` to e.g.
`setCreateStateGatewaySender(GatewaySenderState state)` that will reflect the
state that was used at gateway-sender creation?
I would be really grateful if you could share some more details.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]