1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-18 13:54:11 +03:00

Fixed a really dumb error where I had Sync writing 0's over the data.

Also added a couple things out of paranoia.
This commit is contained in:
Patrick LeBlanc
2019-04-24 11:33:34 -05:00
parent 4d49f9cc1e
commit 7eebc7f06f

View File

@@ -316,7 +316,7 @@ void Synchronizer::synchronizeDelete(const string &sourceFile, list<string>::ite
/* Don't think it's necessary to lock here. Sync is being told to delete a file on cloud storage.
Presumably the caller has removed it from metadata & the cache, so it is no longer referencable.
*/
//ScopedWriteLock s(ioc, sourceFile);
ScopedWriteLock s(ioc, sourceFile);
cs->deleteObject(*it);
}
@@ -364,13 +364,14 @@ void Synchronizer::synchronizeWithJournal(const string &sourceFile, list<string>
}
throw runtime_error(string("Synchronizer: getObject() failed: ") + strerror_r(errno, buf, 80));
}
assert(size <= mdEntry.length);
//TODO!! This sucks. Need a way to pass in a larger array to cloud storage, and also have it not
// do any add'l alloc'ing or copying
if (size < mdEntry.length)
{
boost::shared_array<uint8_t> tmp(new uint8_t[mdEntry.length]());
memcpy(tmp.get(), data.get(), size);
memset(tmp.get(), 0, mdEntry.length - size); // prob not necessary outside of testing
memset(&tmp[size], 0, mdEntry.length - size); // prob not necessary outside of testing
data.swap(tmp);
size = mdEntry.length;
}