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,6 +584,7 @@ void IOCoordinator::deleteMetaFile(const bf::path &file)
|
||||
tell cache they were deleted
|
||||
tell synchronizer to delete them in cloud storage
|
||||
*/
|
||||
//cout << "deleteMetaFile called on " << file << endl;
|
||||
|
||||
Synchronizer *synchronizer = Synchronizer::get();
|
||||
|
||||
@@ -600,6 +601,7 @@ void IOCoordinator::deleteMetaFile(const bf::path &file)
|
||||
vector<string> deletedObjects;
|
||||
for (auto &object : objects)
|
||||
{
|
||||
//cout << "deleting " << object.key << endl;
|
||||
int result = cache->ifExistsThenDelete(object.key);
|
||||
if (result & 0x1)
|
||||
replicator->remove(cachePath/object.key);
|
||||
@@ -622,7 +624,12 @@ void IOCoordinator::remove(const bf::path &p)
|
||||
remove(*entry);
|
||||
++entry;
|
||||
}
|
||||
bf::remove(p);
|
||||
//cout << "removing dir " << p << endl;
|
||||
#ifndef NDEBUG
|
||||
assert(replicator->remove(p) == 0);
|
||||
#else
|
||||
replicator->remove(p);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -635,8 +642,12 @@ void IOCoordinator::remove(const bf::path &p)
|
||||
bf::path possibleMetaFile = p.string() + ".meta";
|
||||
if (bf::is_regular_file(possibleMetaFile))
|
||||
deleteMetaFile(possibleMetaFile);
|
||||
else
|
||||
bf::remove(p); // if p.meta doesn't exist, and it's not a dir, then just throw it out
|
||||
else if (bf::exists(p))
|
||||
#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
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
assert(boost::filesystem::remove_all(filename) > 0);
|
||||
#else
|
||||
boost::filesystem::remove_all(filename);
|
||||
#endif
|
||||
}
|
||||
catch(boost::filesystem::filesystem_error &e)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
cout << "Replicator::remove(): caught an execption: " << e.what() << endl;
|
||||
assert(0);
|
||||
#endif
|
||||
errno = e.code().value();
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user