Backup and reindexing always started when opening a repository

Nov 24, 2015 at 3:41 PM
Edited Nov 24, 2015 at 3:49 PM
Why is there a need to start the backup after each RaptorDB.Open call?

The application flow is like this:
  1. I have an indexing application which reads a fairly large dataset from a remote database and creates in the background the raptordb document collections. All is well in this case. The number of docs is around 4.5M;
  2. I take all generated files and copy them to a location where my main application is supposed to run. Copy goes well, no errors or problems in the middle;
  3. the indexer and the main application are both using the same assembly where the docs are defined - so there should be no problems with the versions and the data types;
  4. When I start the main application and try to open the repository, it takes 15 minutes until I am getting the first response. Each time I am doing this, no matter if the previous ran shut down well or not, the backup is kicking off.
The raptor configuration file on the copied repository looks like this:
{
   "BitmapOffsetSwitchOverCount" : 10,
   "BackgroundSaveToOtherViews" : false,
   "DefaultStringKeySize" : 60,
   "FreeBitmapMemoryOnSave" : false,
   "PageItemCount" : 10000,
   "SaveIndexToDiskTimerSeconds" : 1800,
   "FlushStorageFileImmediately" : false,
   "SaveAsBinaryJSON" : true,
   "TaskCleanupTimerSeconds" : 3,
   "BackgroundSaveViewTimer" : 1,
   "BackgroundViewSaveBatchSize" : 1000000,
   "FullTextTimerSeconds" : 15,
   "BackgroundFullTextIndexBatchSize" : 10000,
   "FreeMemoryTimerSeconds" : 1800,
   "MemoryLimit" : 100,
   "BackupCronSchedule" : "0 0 1 12 *",
   "RequirePrimaryView" : true,
   "PackageSizeItemCountLimit" : 10000,
   "ProcessInboxTimerSeconds" : 10,
   "SplitStorageFilesMegaBytes" : 0,
   "CompressDocumentOverKiloBytes" : 100,
   "HighFrequencyKVDiskBlockSize" : 2048,
   "EnableOptimizedStringIndex" : true
}
As you can see, I changed the backup schedule to go once in a year. Normally, I don't need backup as this will be a read-only repository. So, if it crash, I can easily regenerate it.

The raptor logging (with or without logging, the time is quite the same) looks like this:
RaptorDB starting...
2015-11-24 17:12:32|DEBUG|3|RaptorDB.RaptorDB|| RaptorDB data folder = C:\Search\bin\Debug\Dictionary\
2015-11-24 17:12:32|DEBUG|3|RaptorDB.KeyStore`1|| Current Count = 4,688,982
2015-11-24 17:12:32|DEBUG|3|RaptorDB.KeyStore`1|| Checking Index state...
2015-11-24 17:12:32|DEBUG|3|RaptorDB.KeyStore`1|| Rebuilding index...
2015-11-24 17:12:32|DEBUG|3|RaptorDB.KeyStore`1||    last index count = 0
2015-11-24 17:12:32|DEBUG|3|RaptorDB.KeyStore`1||    data items count = 4688982
2015-11-24 17:12:32|DEBUG|3|RaptorDB.KeyStore`1|| 100,000 items re-indexed
2015-11-24 17:12:34|DEBUG|3|RaptorDB.KeyStore`1|| 100,000 items re-indexed
.....
2015-11-24 17:14:54|DEBUG|3|RaptorDB.KeyStore`1|| 100,000 items re-indexed
2015-11-24 17:14:57|DEBUG|3|RaptorDB.KeyStore`1|| Rebuild index done.
2015-11-24 17:14:57|DEBUG|3|RaptorDB.KeyStore`1|| Starting save timer
2015-11-24 17:14:57|DEBUG|3|RaptorDB.KeyStore`1|| Current Count = 0
2015-11-24 17:14:57|DEBUG|3|RaptorDB.KeyStore`1|| Checking Index state...
2015-11-24 17:14:57|DEBUG|3|RaptorDB.KeyStore`1|| Starting save timer
2015-11-24 17:14:57|DEBUG|3|RaptorDB.Views.TaskQueue|| TaskQueue starting
2015-11-24 17:14:57|DEBUG|3|RaptorDB.Hoot|| Starting hOOt....
2015-11-24 17:14:57|DEBUG|3|RaptorDB.Hoot|| Storage Folder = C:\Search\bin\Debug\Dictionary\Data\Fulltext\
2015-11-24 17:14:57|DEBUG|3|RaptorDB.KeyStore`1|| Current Count = 0
2015-11-24 17:14:57|DEBUG|3|RaptorDB.KeyStore`1|| Checking Index state...
2015-11-24 17:14:57|DEBUG|3|RaptorDB.KeyStore`1|| Starting save timer
2015-11-24 17:14:57|DEBUG|3|RaptorDB.RaptorDB|| Backup Started...
2015-11-24 17:14:57|DEBUG|3|RaptorDB.RaptorDB|| Copying data to backup
2015-11-24 17:17:50|DEBUG|3|RaptorDB.RaptorDB|| Last backup rec# = 4688982
2015-11-24 17:20:42|DEBUG|3|RaptorDB.RaptorDB|| Backup compressed and done
2015-11-24 17:20:42|DEBUG|3|RaptorDB.RaptorDB|| last backup record = 0
2015-11-24 17:20:42|DEBUG|3|RaptorDB.RaptorDB|| Backup done.
So, normally, if the repository was not modified and if I am using the same documents (version is the same) - reindexing/backup should not start ...