Changeset 74cb121 in trunk
- Timestamp:
- 2019-08-14T15:44:12Z (6 years ago)
- Branches:
- master
- Children:
- 6d414b07
- Parents:
- dcc8f93
- Location:
- src/allmydata
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/allmydata/storage/server.py ¶
rdcc8f93 r74cb121 483 483 484 484 if new_length == 0: 485 # delete empty bucket directories 486 if not os.listdir(bucketdir): 485 # delete bucket directories that exist but are empty. They 486 # might not exist if a client showed up and asked us to 487 # truncate a share we weren't even holding. 488 if os.path.exists(bucketdir) and [] == os.listdir(bucketdir): 487 489 os.rmdir(bucketdir) 488 490 return remaining_shares -
TabularUnified src/allmydata/test/test_storage.py ¶
rdcc8f93 r74cb121 1369 1369 self.failUnless(os.path.exists(prefixdir), prefixdir) 1370 1370 self.failIf(os.path.exists(bucketdir), bucketdir) 1371 1372 def test_remove_non_present(self): 1373 """ 1374 A write vector which would remove a share completely can be applied on a 1375 server which does not have the share as a no-op. 1376 """ 1377 ss = self.create("test_remove_non_present") 1378 1379 storage_index = "si1" 1380 secrets = ( 1381 self.write_enabler(storage_index), 1382 self.renew_secret(storage_index), 1383 self.cancel_secret(storage_index), 1384 ) 1385 1386 sharenum = 3 1387 testv = [] 1388 datav = [] 1389 new_length = 0 1390 read_vector = [] 1391 1392 # We don't even need to create any shares to exercise this 1393 # functionality. Just go straight to sending a truncate-to-zero 1394 # write. 1395 testv_is_good, read_data = ss.remote_slot_testv_and_readv_and_writev( 1396 storage_index=storage_index, 1397 secrets=secrets, 1398 test_and_write_vectors={ 1399 sharenum: (testv, datav, new_length), 1400 }, 1401 read_vector=read_vector, 1402 ) 1403 1404 self.assertTrue(testv_is_good) 1405 self.assertEqual({}, read_data) 1371 1406 1372 1407
Note: See TracChangeset
for help on using the changeset viewer.