xadisk
  1. xadisk
  2. XADISK-132

XADisk hangs on commit after directory delete and recreate

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.2.2
    • Component/s: filesystem
    • Labels:
      None
    • Environment:

      Windows 7 64-bit, Java 1.7, Eclipse Juno, Open EJB

      Description

      When doing some performance tests on XADisk which delete and recreate directories I stumbled over this issue (note: the performance is completely satisactory):

      XADisk totally hangs on the second commit of changes to a file in a directory which has been deleted and recreated (over XADisk).
      And even worse this persists after stopping the thread and recovery (the recovery hangs). Only deleteing the XADisk work dir helps.

      The issue can be easily reproduced with this JUnit test:

      public class XaDirectoryTest extends TestCase {

      public void testXaDirectory() throws Exception

      { IOTools.deleteAll(new File("target/xadisk-fail")); testXaDirectory(true); testXaDirectory(false); }

      private void testXaDirectory(final boolean first) throws Exception {
      String xadiskSystemDirectory = "target/xadisk-fail/system";
      File sampleDataDir1 = new File("target/xadisk-fail/data");
      XAFileSystem xafs = null;

      try {
      System.out.println("Booting XADisk...");
      StandaloneFileSystemConfiguration configuration = new StandaloneFileSystemConfiguration(
      xadiskSystemDirectory, "id-1");

      xafs = XAFileSystemProxy.bootNativeXAFileSystem(configuration);
      xafs.waitForBootup(-1);
      System.out.println("XADisk is now available for use.");

      Session session = xafs.createSessionForLocalTransaction();

      try {
      File testFile = new File(sampleDataDir1, "a.txt");
      if (first)

      { assertFalse(session.fileExists(sampleDataDir1, false)); }

      else

      { assertTrue(session.fileExists(sampleDataDir1, false)); assertTrue(session.fileExists(testFile, false)); System.out.println("deleting existing " + testFile + "."); session.deleteFile(testFile); // without this delete (and recreate below) everything works fine System.out.println("deleting existing " + sampleDataDir1 + "."); session.deleteFile(sampleDataDir1); }

      System.out.println("creating " + sampleDataDir1 + ".");
      session.createFile(sampleDataDir1, true);
      System.out.println("creating " + testFile + ".");
      session.createFile(testFile, false);

      System.out.println("writing " + testFile + ".");
      OutputStream xaos = new XAFileOutputStreamWrapper(session.createXAFileOutputStream(testFile, true));
      xaos.write("Hellow World".getBytes());
      xaos.close();

      System.out.println("committing " + testFile + ".");
      session.commit();

      if (!first)

      { System.out.println("never gets here because it hangs."); }

      } catch (XAApplicationException xaae)

      { session.rollback(); throw xaae; }

      } finally {
      if (xafs != null) {
      try

      { xafs.shutdown(); }

      catch (IOException ioe)

      { ioe.printStackTrace(); }

      }
      }
      System.out.println("XADisk is down.");
      }
      }

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Nitin Verma
            Reporter:
            gunnar_zarncke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: