[ 
https://issues.apache.org/jira/browse/SOLR-15706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17438904#comment-17438904
 ] 

ASF subversion and git services commented on SOLR-15706:
--------------------------------------------------------

Commit b532f4dc604d01dbddd8e45ee5cc16d3e3afe0b3 in solr's branch 
refs/heads/main from Jason Gerlowski
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=b532f4d ]

SOLR-15706: Fix incorrect path in backup purging

Prior to this commit the backup purging logic used an incorrect path to
lookup the 'shard_backup_metadata' directory.  This caused it to not
find the right metadata files, and ultimately treat all (!) index files
as "orphaned" and ready for deletion.

This commit fixes this problem by correcting the path used in this path
of DeleteBackupCmd.  It also rewrites our PurgeGraphTest unit tests to
use real paths instead of relying heavily on mocks.  Bringing them more
closely into line with the actual file structure that appears in
production should make them more effective at detecting terrible bugs
like this one.


> After an incremental back up, the pugeUnused operation incorrectly deletes 
> all backed up data
> ---------------------------------------------------------------------------------------------
>
>                 Key: SOLR-15706
>                 URL: https://issues.apache.org/jira/browse/SOLR-15706
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Backup/Restore
>    Affects Versions: 8.9
>            Reporter: Don
>            Assignee: Jason Gerlowski
>            Priority: Blocker
>         Attachments: reproduce.sh
>
>
> Reproduction Steps: # Create a collection _'foo',_
>  # Insert small number of documents (_say 10_) into collection _'foo'_
>  # Backup collection _'foo'_ using collections API 
> (/admin/collections?action=BACKUP), this should result in creation of 
> _backupId 0_
>  # Backup collection _'foo'_ again using collections API 
> (/admin/collections?action=BACKUP), this should result in creation of 
> _backupId 1_
>  # Delete _backupId 0_ for collection _'foo'_ 
> (/admin/collections?action=DELETEBACKUP?backupId=0)
>  # Run delete backup for collection _'foo'_ again, this time with 
> _'purgeUnused=true'_ (/admin/collections?action=DELETEBACKUP?purgeUnused=true)
>  # Restore from _backupId 1_ which still exists to collection _'bar'_ 
> (/admin/collections?action=RESTORE)
> Expected Result: # Restored collection 'bar' has 10 documents in it
> Actual Result: # Restored collection 'bar' has 0 documents in it
> We found in our testing that when purge is used it incorrectly deletes all 
> backup data instead of just the unused data as it supposed to.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to