You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-20 01:42:27 +03:00
Added some commented debugging printouts & some assertions around
deletion to make sure we're deleting things.
This commit is contained in:
@@ -584,7 +584,8 @@ void IOCoordinator::deleteMetaFile(const bf::path &file)
|
|||||||
tell cache they were deleted
|
tell cache they were deleted
|
||||||
tell synchronizer to delete them in cloud storage
|
tell synchronizer to delete them in cloud storage
|
||||||
*/
|
*/
|
||||||
|
//cout << "deleteMetaFile called on " << file << endl;
|
||||||
|
|
||||||
Synchronizer *synchronizer = Synchronizer::get();
|
Synchronizer *synchronizer = Synchronizer::get();
|
||||||
|
|
||||||
// this is kind of ugly. We need to lock on 'file' relative to metaPath, and without the .meta extension
|
// this is kind of ugly. We need to lock on 'file' relative to metaPath, and without the .meta extension
|
||||||
@@ -600,6 +601,7 @@ void IOCoordinator::deleteMetaFile(const bf::path &file)
|
|||||||
vector<string> deletedObjects;
|
vector<string> deletedObjects;
|
||||||
for (auto &object : objects)
|
for (auto &object : objects)
|
||||||
{
|
{
|
||||||
|
//cout << "deleting " << object.key << endl;
|
||||||
int result = cache->ifExistsThenDelete(object.key);
|
int result = cache->ifExistsThenDelete(object.key);
|
||||||
if (result & 0x1)
|
if (result & 0x1)
|
||||||
replicator->remove(cachePath/object.key);
|
replicator->remove(cachePath/object.key);
|
||||||
@@ -622,7 +624,12 @@ void IOCoordinator::remove(const bf::path &p)
|
|||||||
remove(*entry);
|
remove(*entry);
|
||||||
++entry;
|
++entry;
|
||||||
}
|
}
|
||||||
bf::remove(p);
|
//cout << "removing dir " << p << endl;
|
||||||
|
#ifndef NDEBUG
|
||||||
|
assert(replicator->remove(p) == 0);
|
||||||
|
#else
|
||||||
|
replicator->remove(p);
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -635,8 +642,12 @@ void IOCoordinator::remove(const bf::path &p)
|
|||||||
bf::path possibleMetaFile = p.string() + ".meta";
|
bf::path possibleMetaFile = p.string() + ".meta";
|
||||||
if (bf::is_regular_file(possibleMetaFile))
|
if (bf::is_regular_file(possibleMetaFile))
|
||||||
deleteMetaFile(possibleMetaFile);
|
deleteMetaFile(possibleMetaFile);
|
||||||
else
|
else if (bf::exists(p))
|
||||||
bf::remove(p); // if p.meta doesn't exist, and it's not a dir, then just throw it out
|
#ifndef NDEBUG
|
||||||
|
assert(replicator->remove(p) == 0); // if p.meta doesn't exist, and it's not a dir, then just throw it out
|
||||||
|
#else
|
||||||
|
replicator->remove(p);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,10 +195,18 @@ int Replicator::remove(const boost::filesystem::path &filename, Flags flags)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
boost::filesystem::remove_all(filename);
|
#ifndef NDEBUG
|
||||||
|
assert(boost::filesystem::remove_all(filename) > 0);
|
||||||
|
#else
|
||||||
|
boost::filesystem::remove_all(filename);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
catch(boost::filesystem::filesystem_error &e)
|
catch(boost::filesystem::filesystem_error &e)
|
||||||
{
|
{
|
||||||
|
#ifndef NDEBUG
|
||||||
|
cout << "Replicator::remove(): caught an execption: " << e.what() << endl;
|
||||||
|
assert(0);
|
||||||
|
#endif
|
||||||
errno = e.code().value();
|
errno = e.code().value();
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user