ctubbsii commented on a change in pull request #1677:
URL: https://github.com/apache/accumulo/pull/1677#discussion_r469943207



##########
File path: 
server/base/src/main/java/org/apache/accumulo/server/ServerContext.java
##########
@@ -68,13 +68,22 @@
   private CryptoService cryptoService = null;
 
   public ServerContext(SiteConfiguration siteConfig) {
-    this(new ServerInfo(siteConfig));
+    this(new ServerInfo(siteConfig), true);
+  }
+
+  public ServerContext(SiteConfiguration siteConfig, boolean 
enableZookeeperRetries) {
+    this(new ServerInfo(siteConfig), enableZookeeperRetries);
   }
 
   private ServerContext(ServerInfo info) {
+    this(info, true);
+  }
+
+  private ServerContext(ServerInfo info, boolean enableRetries) {
     super(SingletonReservation.noop(), info, info.getSiteConfiguration());
     this.info = info;
-    zooReaderWriter = new ZooReaderWriter(info.getSiteConfiguration());
+    zooReaderWriter = enableRetries ? 
ZooReaderWriter.retriesEnabled(info.getSiteConfiguration())
+        : ZooReaderWriter.retriesDisabled(info.getSiteConfiguration());

Review comment:
       > It sounds as if you both might be leaning toward a solution that does 
not use ZooLock for the tablet server lock, but uses something else that does 
not retry and communicates directly with ZooKeeper. Is that correct?
   
   I don't think that's quite right. I don't think it makes sense to distance 
ourselves from using ZooLock for locking (doesn't it exist for that purpose?). 
Rather, I think we're suggesting that the implementation of ZooLock should be 
changed to distance itself from the general-purpose utilities of 
ZooReaderWriter/ZooSession. This can be done by making ZooLock never use those 
at all and use something of its own, or as Keith suggested, adding 
special-purpose methods on those utilities for ZooLock to safely use.
   
   > @ctubbsii - did you want me to wait for #1459 to be completed before 
revisiting this?
   
   That depends. #1459 had no intention of touching ZooLock, so if you want to 
try to make ZooLock work without ZooReaderWriter/ZooSession, then your efforts 
should not conflict with that and can proceed independently. If, however, you 
want to try to add special-purpose methods for ZooLock on 
ZooReaderWriter/ZooSession, then it should wait, and I can prioritize my 
efforts next week to clean those up to make it easier for you.
   




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