Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-6807

Windows doesn't move existing files out of the way when creating a new file with the same name

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • 5

      Looking at some code, it's expected that WiredTiger renames any existing files out of the way when trying to create new files. This does happen to a certain extent, just not on Windows machines from my observation, and so I just wanted to find some clarification on the behaviour here or if this is indeed a bug.

      On my Linux machine running the test case below fails and I get:

      "unexpected file conflicting_rename found, renamed to conflicting_rename.1"
      

      But on Windows, there is no renaming and the test simply passes.

      See evergreen for more info.
       

      I've created a simple test case to demonstrate this (run in evergreen above):

      python3 test/suite/run.py test_conflicting_rename.py
      
      diff --git a/test/suite/test_conflicting_rename.py b/test/suite/test_conflicting_rename.py
      new file mode 100644
      index 000000000..b9e49035a
      --- /dev/null
      +++ b/test/suite/test_conflicting_rename.py
      @@ -0,0 +1,9 @@
      +import wiredtiger, wttest
      +
      +class test_conflicting_rename(wttest.WiredTigerTestCase):
      +    uri = 'file:conflicting_rename'
      +
      +    def test_conflicting_rename(self):
      +        self.session.create(self.uri, 'key_format=S,value_format=S')
      +        self.session.drop(self.uri, 'remove_files=false')
      +        self.session.create(self.uri, 'key_format=S,value_format=S')
      

       

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: