Changeset 1784 for box/chris/general/bin/bbstored/HousekeepStoreAccount.cpp
- Timestamp:
- 01/08/2007 00:18:50 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
box/chris/general/bin/bbstored/HousekeepStoreAccount.cpp
r1321 r1784 10 10 #include "Box.h" 11 11 12 #include <stdio.h> 13 12 14 #include <map> 13 #include <stdio.h>14 15 15 16 #include "HousekeepStoreAccount.h" … … 138 139 { 139 140 // Log this 140 ::syslog(LOG_ERR, "On housekeeping, sizes in store do not match calculated sizes, correcting"); 141 ::syslog(LOG_ERR, "different (store,calc): acc 0x%08x, used (%lld,%lld), old (%lld,%lld), deleted (%lld,%lld), dirs (%lld,%lld)", 142 mAccountID, 143 (used + mBlocksUsedDelta), mBlocksUsed, (usedOld + mBlocksInOldFilesDelta), mBlocksInOldFiles, 144 (usedDeleted + mBlocksInDeletedFilesDelta), mBlocksInDeletedFiles, usedDirectories, mBlocksInDirectories); 141 BOX_ERROR("Housekeeping on account " << 142 BOX_FORMAT_ACCOUNT(mAccountID) << " found " 143 "and fixed wrong block counts: " 144 "used (" << 145 (used + mBlocksUsedDelta) << "," << 146 mBlocksUsed << "), old (" << 147 (usedOld + mBlocksInOldFilesDelta) << "," << 148 mBlocksInOldFiles << "), deleted (" << 149 (usedDeleted + mBlocksInDeletedFilesDelta) << 150 "," << mBlocksInDeletedFiles << "), dirs (" << 151 usedDirectories << "," << mBlocksInDirectories 152 << ")"); 145 153 } 146 154 … … 174 182 if(mFilesDeleted > 0 || mEmptyDirectoriesDeleted > 0) 175 183 { 176 ::syslog(LOG_INFO, "Account 0x%08x, removed %lld blocks (%lld files, %lld dirs)%s", mAccountID, 0 - (mBlocksUsedDelta + removeASAPBlocksUsedDelta), 177 mFilesDeleted, mEmptyDirectoriesDeleted, 178 deleteInterrupted?" was interrupted":""); 184 BOX_INFO("Housekeeping on account " << 185 BOX_FORMAT_ACCOUNT(mAccountID) << " " 186 "removed " << 187 (0 - (mBlocksUsedDelta + removeASAPBlocksUsedDelta)) << 188 " blocks (" << mFilesDeleted << " files, " << 189 mEmptyDirectoriesDeleted << " dirs)" << 190 (deleteInterrupted?" and was interrupted":"")); 179 191 } 180 192 181 193 // Make sure the delta's won't cause problems if the counts are really wrong, and 182 194 // it wasn't fixed because the store was updated during the scan. 183 if(mBlocksUsedDelta < (0 - info->GetBlocksUsed())) mBlocksUsedDelta = (0 - info->GetBlocksUsed()); 184 if(mBlocksInOldFilesDelta < (0 - info->GetBlocksInOldFiles())) mBlocksInOldFilesDelta = (0 - info->GetBlocksInOldFiles()); 185 if(mBlocksInDeletedFilesDelta < (0 - info->GetBlocksInDeletedFiles())) mBlocksInDeletedFilesDelta =(0 - info->GetBlocksInDeletedFiles()); 186 if(mBlocksInDirectoriesDelta < (0 - info->GetBlocksInDirectories())) mBlocksInDirectoriesDelta = (0 - info->GetBlocksInDirectories()); 195 if(mBlocksUsedDelta < (0 - info->GetBlocksUsed())) 196 { 197 mBlocksUsedDelta = (0 - info->GetBlocksUsed()); 198 } 199 if(mBlocksInOldFilesDelta < (0 - info->GetBlocksInOldFiles())) 200 { 201 mBlocksInOldFilesDelta = (0 - info->GetBlocksInOldFiles()); 202 } 203 if(mBlocksInDeletedFilesDelta < (0 - info->GetBlocksInDeletedFiles())) 204 { 205 mBlocksInDeletedFilesDelta = (0 - info->GetBlocksInDeletedFiles()); 206 } 207 if(mBlocksInDirectoriesDelta < (0 - info->GetBlocksInDirectories())) 208 { 209 mBlocksInDirectoriesDelta = (0 - info->GetBlocksInDirectories()); 210 } 187 211 188 212 // Update the usage counts in the store … … 555 579 if(pentry == 0) 556 580 { 557 ::syslog(LOG_ERR, "acc 0x%08x, object %lld not found in dir %lld, logic error/corruption? Run bbstoreaccounts check <accid> fix", mAccountID, ObjectID, InDirectory); 581 BOX_ERROR("Housekeeping on account " << 582 BOX_FORMAT_ACCOUNT(mAccountID) << " " 583 "found error: object " << 584 BOX_FORMAT_OBJECTID(ObjectID) << " " 585 "not found in dir " << 586 BOX_FORMAT_OBJECTID(InDirectory) << ", " 587 "indicates logic error/corruption? Run " 588 "bbstoreaccounts check <accid> fix"); 558 589 return; 559 590 }
Note: See TracChangeset
for help on using the changeset viewer.
