This is an automated email from the ASF dual-hosted git repository.

mhubail pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 07d202d  [NO ISSUE][REP] Do not fail create/drop resource on replica 
failure
07d202d is described below

commit 07d202d17ab0131703cc6731506d9880d180e65b
Author: Murtadha Hubail <[email protected]>
AuthorDate: Thu Aug 26 02:27:42 2021 +0300

    [NO ISSUE][REP] Do not fail create/drop resource on replica failure
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    
    - When creating/dropping a resource, do not fail the operation
      on the master node if it fails to send the opreation to the
      replica. When the replica node is recovered, it will be
      re-synced and will pick up all the changes.
    
    Change-Id: I8313569cfda4b7e4fbeb23d4fdb998b3805367e1
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/12985
    Integration-Tests: Jenkins <[email protected]>
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Murtadha Hubail <[email protected]>
    Reviewed-by: Ali Alsuliman <[email protected]>
---
 .../management/resource/PersistentLocalResourceRepository.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
 
b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
index 2494893..3b192aa 100644
--- 
a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
+++ 
b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
@@ -212,7 +212,11 @@ public class PersistentLocalResourceRepository implements 
ILocalResourceReposito
         resourceCache.put(resource.getPath(), resource);
         //if replication enabled, send resource metadata info to remote nodes
         if (isReplicationEnabled) {
-            createReplicationJob(ReplicationOperation.REPLICATE, resourceFile);
+            try {
+                createReplicationJob(ReplicationOperation.REPLICATE, 
resourceFile);
+            } catch (Exception e) {
+                LOGGER.error("failed to send resource file {} to replicas", 
resourceFile);
+            }
         }
     }
 
@@ -233,8 +237,10 @@ public class PersistentLocalResourceRepository implements 
ILocalResourceReposito
         FileReference resourceFile = getLocalResourceFileByName(ioManager, 
relativePath);
         try {
             if (resourceFile.getFile().exists()) {
-                if (isReplicationEnabled) {
+                try {
                     createReplicationJob(ReplicationOperation.DELETE, 
resourceFile);
+                } catch (Exception e) {
+                    LOGGER.error("failed to delete resource file {} from 
replicas", resourceFile);
                 }
                 final LocalResource localResource = 
readLocalResource(resourceFile.getFile());
                 IoUtil.delete(resourceFile);

Reply via email to