Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
6.4
-
None
-
None
Description
It can be easily observed when backup size is big (I tested it with 1GB backup).
I encountered it on 6.4 but quick look at the code shows that 7.x is affected as well.
How to reproduce:
1) start solr, create core and index some data
2) call /replication?command=backup
3) call (multiple times) /replication?command=details
For some time "backup" will be missing in the response (because backup is in progress) then it will report "success" and other properties
4) call /replication?command=backup again
5) call (multiple times) replication?command=details
For some time old "backup" status will be returned: with status "success" (misleading!) - there is no indication that backup is in progress.
The only way to detect if backup is really done (workaround):
1) store value of startTime/snapshotCompletedAt
2) call /replication?command=backup
3) call /replication?command=details and check if startTime/snapshotCompletedAt is different
Root cause of the problem: snapShootDetails field of org.apache.solr.handler.ReplicationHandler is being returned by getReplicationDetails.
This fields is updated by org.apache.solr.handler.SnapShooter::createSnapAssync when the backup is done. If "details" is called after backup start but before it ends - outdated value will be returned.
Possible fix:
snapShootDetails should be updated before calling SnapShooter::createSnapAssync:
1) quick and dirty: set snapShootDetails to null (quite ugly it will be consistent with first call to "backup" command)
2) Extend "backup" (add properties) - store previous backup (or last successful) status as field in "backup" and update other fields before createSnapAssync is called (update startTime, set status to "In Progress", remove snapshotCompletedAt, snapshotName, fileCount)