2 Replies Latest reply on Mar 6, 2014 12:56 PM by pcombellick

    Deleting AF trees

    AlistairFrith

      We have an AF hierarchy with 3 large trees. I need to delete the largest tree, which has tens of thousands of elements within it, before running a custom application to re-create it. Unfortunately, I am having difficulty with this.

      • First I deleted all the elements under the top of this tree, about 300 in all with the others thousands below them.
      • Then I tried to check this change in. After about 10 minutes it timed out.
      • So I tried undoing the checkout. Again it timed out after about 10 minutes
      • Then I exported the rest of the AF database to a file, intending to create a new DB and re-import. 
      • Then I tried to rename the existing database. Again, this timed out after about 10 minutes.
      • Then I tried to delete the AF database but had to go home before it completed.
      So my question is, what is the best way to do this and how can I recover from it? As a last resort, I can delete the PIFD SQL database hosting the AF database if that will help, but I need to know the best way.
      --- Alistair.
        • Re: Deleting AF trees
          AlistairFrith

          Having come in this morning, it appears to have all been done during the night: the database is gone so I have re-created it and am importing the elements I exported in step 4.

           

          Speaking to a colleague, it seems that the timeout message is just for AF Explorer and the AF Server actually continues to perform the requested operation in the background. So if I had just waited, my initial element deletions would have been checked in eventually and AF Explorer would have stopped timing out. Is this correct? If so, are there any plans to make this more informative because at the moment the timeout message gives the impression that the requested operation has actually failed.

           

          Or am I completely misunderstanding how these operations work?!

           

          --- Alistair.

           

           

            • Re: Deleting AF trees
              pcombellick

              Alistair,

               

              The timeout message that you received was likely the timeout of the communication between the AFSDK and the AFServer, which, by default, will timeout in 5 minutes.  Deleting an AFDatabase, is partly synchronous but mostly asynchronous.  The synchronous part, marks the AFDatabase for deletion, then returns control to the PSE.  The AFServer continues to work on the AFDatabase delete, in the background.  Deleting a large tree of AFElements, without intending to delete an entire AFDatabase, can be slow, and once started, can have an impact on other operations.  If you plan to add a large set of AFElements and then delete them, regularly, I would consider putting then in their own AFDatabase and then just delete the entire AFDatabase.  If this is a test environment, and you don't need to preserve any of the data, consider dropping the entire PIFD database.

               

              In my development environment, I frequently delete the entire PIFD and recreate PIFD by running the SQL scripts from .BAT file or install a fresh PIFD, run a SQL BACKUP command, run tests, then run a SQL script to break all the connections and restore the "fresh" backup, via SQL script.  Obviously, this purges all of your data, but it can be helpful for certain test scenarios.

               

              Each release of AF we work to improve delete performance, but as the relationship between AFElements and other AF Objects matures, there are more things to check on deletion, such as the relationships between AFElements, the relationship between AFElements and AFNotifications, and the relationship between AFElements and AFAnalyses.

               

              What version of AF Server are you using?  What version & edition of SQL Server are you using?  How much RAM is allocated to SQL Server?  What is the IO capacity of the drives that PIFD is stored on?

               

              Regards,

               

              Paul

               

              AF Dev