lhotari commented on a change in pull request #10605:
URL: https://github.com/apache/pulsar/pull/10605#discussion_r634067438



##########
File path: site2/docs/concepts-architecture-overview.md
##########
@@ -29,6 +29,10 @@ Messages are typically dispatched out of a [managed 
ledger](#managed-ledgers) ca
 
 Finally, to support geo-replication on global topics, the broker manages 
replicators that tail the entries published in the local region and republish 
them to the remote region using the Pulsar [Java client 
library](client-libraries-java.md).
 
+> **Note**
+> 
+> Broker is thread-safe when running on 64-bit JVM.

Review comment:
       > I don't think it's necessary to add a note here, the issues that 
#10280 mention are not serious problems? it's might affect the Ledger rollover?
   
   @codelipenghui There are several serious thread-safety problems if Broker 
would be run on 32-bit JVM. There are multiple locations where it is assumed 
that writing of long and double fields are atomic. This assumption is valid on 
64-bit JVMs, but not on 32-bit JVMs. When reviewing broker code, it's necessary 
to know that it's fine to assume that long and double field write are atomic 
since it will be only run on 64-bit JVMs and there isn't a risk of the "word 
tearing problem" that happens on 32-bit JVMs for long/double field write.
   As discussed in #10280, the resolution would be to simply document that 
Broker is only supported on 64-bit JVMs. It's very unlikely that there would be 
anyone trying to run it on 32-bit JVMs. I think the impact of this 
clarification is greater for code reviews where issues such as the one in 
#10280 aren't reported as issues when everyone knows that it's fine to assume 
that long and double field writes are atomic (since we only support 64-bit 
JVMs).
   
   @Anonymitaet I think it might be better to omit "thread-safe" in the 
sentence. It's probably sufficient to say that Pulsar Broker is only supported 
on 64-bit JVMs.  This applies only to Pulsar Broker code. I guess that the 
shared Pulsar common code and Pulsar client is supported on both 32-bit and 
64-bit JVMs for Java 8+.
   Perhaps this requirement of the 64-bit JVM can be mentioned in the 
documentation where it has other requirements for the broker? (is there some 
documentation about minimum memory requirements etc?)




-- 
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]


Reply via email to