sarkaramrit1993 opened a new pull request, #5066:
URL: https://github.com/apache/solr/pull/5066

   https://issues.apache.org/jira/browse/SOLR-17953
   
   A .DS_Store (or any dot-prefixed file) next to the collection folder of an 
incremental backup made RESTORE fail with FileAlreadyExistsException, and 
LISTBACKUP and DELETEBACKUP fail with "expected to hold a single directory". It 
also let BACKUP skip its check against putting a second collection under the 
same backup name, since that check only ran when the folder held exactly one 
entry.
   
   # Changes
   - New BackupFilePaths.findCollectionDirs: drops dot-prefixed entries when 
the backup folder has more than one entry. A lone dot-prefixed entry is kept, 
since collection names can start with ".".
   - RESTORE, LISTBACKUP, DELETEBACKUP and BACKUP all use it. RestoreCmd used 
to take the first listed entry and now goes through 
buildExistingBackupLocationURI like LISTBACKUP and DELETEBACKUP.
   
   # Behavior change
   RESTORE now finds the collection folder through the same BackupFilePaths 
lookup that LISTBACKUP and DELETEBACKUP already use:
   - Folder holding two or more collections: RESTORE used to restore whichever 
one was listed first, silently. Now it fails with "expected to hold a single 
directory. Number found: 2", like LISTBACKUP and DELETEBACKUP.
   - Empty or missing backup folder (e.g. a typo in the backup name): RESTORE 
used to fail with ArrayIndexOutOfBoundsException. Now it fails with the same 
message and "Number found: 0". A clearer "backup not found" error would be 
nice, but LISTBACKUP and DELETEBACKUP give the same message today, so I left it 
alone here.
   
   # Why filter by name
   Checking getPathType() for each entry would also catch Windows files like 
Thumbs.db, but on S3 the directory check relies on marker objects that may be 
missing, and it costs a request per entry.
   
   # Not changed
   - A backup folder holding only a .DS_Store is still treated as a collection 
folder named .DS_Store, so BACKUP into it fails. Same as before.
   
   # Tests
   - AbstractIncrementalBackupTest.testHiddenFileInBackupDir: back up, add 
.DS_Store, then restore, list, try backing up a different collection under the 
same name (rejected), and delete. Runs for LocalFS, S3 and GCS. Fails on main.
   - BackupFilePathsTest: hidden file ignored, lone dot-named collection kept, 
two collections rejected.
   
   Applies cleanly to branch_10x. branch_9x has import conflicts only.
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to