felixcheung commented on issue #3387: [ZEPPELIN-3778] Cluster synchronize notes 
& authorization
URL: https://github.com/apache/zeppelin/pull/3387#issuecomment-504717761
 
 
   sure, that's assuming `rename` or `delete` is atomic? it could be in the 
middle of one and both operations failing and leading to data loss etc?
   
   for example, it does look like if there are two move or rename concurrently 
there is a chance the note will be duplicated 
   
   
https://github.com/apache/zeppelin/blob/master/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/NoteManager.java#L210
   
   server1
   ```
       NoteNode noteNode = getNoteNode(notePath);
   ```
   
   server2
   ```
       NoteNode noteNode = getNoteNode(notePath);
   ```
   
   then both execute these concurrently
   ```
       noteNode.getParent().removeNote(getNoteName(notePath));  // not sure 
removeNote will fail
       noteNode.setNotePath(newNotePath);
       String newParent = getFolderName(newNotePath);
       Folder newFolder = getOrCreateFolder(newParent);
       newFolder.addNoteNode(noteNode);
   ```

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


With regards,
Apache Git Services

Reply via email to