Skip to content

Commit

Permalink
Merge pull request #7096 from IQSS/6865-index-fix1
Browse files Browse the repository at this point in the history
6865 index fix 1 for deadlocks
  • Loading branch information
kcondon committed Jul 17, 2020
2 parents e26b366 + 14be6c4 commit f64fcff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ public boolean onSuccess(CommandContext ctxt, Object r) {
retVal = false;
}

ctxt.solrIndex().indexPermissionsForOneDvObject(dataset);
exportMetadata(dataset, ctxt.settings());
ctxt.datasets().updateLastExportTimeStamp(dataset.getId());
return retVal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,6 @@ public IndexResponse indexPermissionsOnSelfAndChildren(DvObject definitionPoint)
}
}
} else if (definitionPoint.isInstanceofDataset()) {
// index the dataset itself
indexPermissionsForOneDvObject(definitionPoint);
dvObjectsToReindexPermissionsFor.add(definitionPoint);
// index files
Dataset dataset = (Dataset) definitionPoint;
Expand All @@ -425,22 +423,15 @@ public IndexResponse indexPermissionsOnSelfAndChildren(DvObject definitionPoint)
*/
String response = reindexFilesInBatches(filesToReindexAsBatch);

List<String> updatePermissionTimeSuccessStatus = new ArrayList<>();
for (DvObject dvObject : dvObjectsToReindexPermissionsFor) {
/**
* @todo do something with this response
*/
IndexResponse indexResponse = indexPermissionsForOneDvObject(dvObject);
DvObject managedDefinitionPoint = dvObjectService.updatePermissionIndexTime(definitionPoint);
boolean updatePermissionTimeSuccessful = false;
if (managedDefinitionPoint != null) {
updatePermissionTimeSuccessful = true;
}
updatePermissionTimeSuccessStatus.add(dvObject + ":" + updatePermissionTimeSuccessful);
}

return new IndexResponse("Number of dvObject permissions indexed for " + definitionPoint
+ " (updatePermissionTimeSuccessful:" + updatePermissionTimeSuccessStatus
+ "): " + dvObjectsToReindexPermissionsFor.size()
+ ": " + dvObjectsToReindexPermissionsFor.size()
);
}

Expand Down

0 comments on commit f64fcff

Please sign in to comment.