Hi, I've been working on a CKAN setup that was using harvesting, DataPusher and DataStore to download and import into our app several datasets periodically everyday. We faced several issues during the process which I already asked in the mailing list.
We got no answer so I'd like to leave our case and solutions documented here so it's easy to find for other people facing the same issues.
Once a day we run the harvesting process, we expect:
There's a race condition in CKAN/DataPusher code that for some cases causes a resource datastore_active_fag be set to false at the end of the import process. This causes the resource views depending on DataStore to not be created.
false is the value in the Solr document, in Postgres it's OK.false, the data is correctly indexed in the datastore db.The harvesting process is capable of detecting which datasets/resources are new and which ones are being updated if you map correctly the attributes you read from the RDF. This is important because otherwise every time you run the harvester you'll create new tables in datastore but the old ones won't be deleted. The problem is that right now DataPusher is only triggered when a new resources is added, so when you try to update one the datastore_active_fag will be set to false, and since the resubmit is not triggered it won't be updated to true later and the resource views will become missing.
To solve problem 1:
datastore_active flags in postgres, and updates the values in Solr if they're different.To solve problem 2:
datapusher submit_all everyday after the harvestingI've experienced similar when uploading via api larger (500k + rows) datasets. I solved this by using the xloader plugin. Its much faster than datapusher, and perhaps should be the default on new installs. Datasets that were problematic to load with datapusher loaded fine with xloader. By default with xloader it loads all into text fields, but I understand you can change the datatype after.
https://github.com/ckan/ckanext-xloader
We read about xloader once we were already deep into the Datapusher setup, and decided to discard it for the moment since we did not have experience with it and we weren't sure if it was stable enough. But for the next time we'll consider giving it a try.
xloader was meant to be a "drop-in" replacement for datapusher and is production-ready.
Datapusher was the single largest source of production support post-install issues for CKAN implementations I've been involved in and highly recommend you use it instead of datapusher.
https://github.com/ckan/ckan/issues/4415
https://ckan.org/2017/11/20/express-loader-for-ckan-datastore/
Most helpful comment
I've experienced similar when uploading via api larger (500k + rows) datasets. I solved this by using the xloader plugin. Its much faster than datapusher, and perhaps should be the default on new installs. Datasets that were problematic to load with datapusher loaded fine with xloader. By default with xloader it loads all into text fields, but I understand you can change the datatype after.
https://github.com/ckan/ckanext-xloader