Bug #966

TBX: 0.7.6, import module abort causes corrupted original corpus

Added by Serge Heiden almost 5 years ago. Updated over 4 years ago.

Status:Feedback Start date:08/06/2014
Priority:High Due date:
Assignee:- % Done:

80%

Category:Import Spent time: -
Target version:TXM 0.7.7

Description

When an import module starts, it asks confirmation to replace original corpus.

Currently, the code delete the original corpus binary.

If the import process is aborted, the original corpus is still present in the corpus view but "is not ready" in the messages bar and is not useable.

An import module abort should put a previously existing corpus back to its original state.

Solution:
  • rename the original corpus binary in a temporary directory with the "_temp" suffix, instead of deleting it
  • if import process is finished without error then delete the temporary directory
  • otherwise
    • rename the broken corpus directory with the "_error" suffix
    • restore the original corpus binary back into the corpora directory.
  • At each import process start, delete the "_error" and "_temp" directories

Validation test

  • starts an import TXT+CSV on a directory with some txt files
  • starts an import TXT+CSV on an empty directory with the same name. The corpora directory should contains the "_error" directory. and the original one must still be ready
  • re starts an import TXT+CSV with the directory with some txt files. The corpora directory should contains the "_temp" directory during the import process. And it should have been deleted at the end of the import process

Related issues

related to Bug #2351: RCP: 0.7.9, CQP corpus re-load "not ready" user message New 03/06/2018

History

#1 Updated by Sebastien Jacquot over 4 years ago

  • Priority changed from Normal to High

#2 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#3 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)
  • % Done changed from 0 to 80

#4 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#5 Updated by Matthieu Decorde over 4 years ago

  • Status changed from New to Feedback

Also available in: Atom PDF