summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Bligh <mbligh@mongodb.com>2015-08-06 13:04:14 -0400
committerRamon Fernandez <ramon@mongodb.com>2016-02-21 12:29:49 -0500
commit3533581b43ae78884e3b5e43b92773a4007baa88 (patch)
treeae6d66cfac3bbceacc42ccdc2de2721772181424 /src
parent3a5a890e1e1832ea8a45607d01ddef36ac3d76fa (diff)
downloadmongo-3533581b43ae78884e3b5e43b92773a4007baa88.tar.gz
SERVER-19800 DataSizeChange forces an int into a bool
Fix for SERVER-22634: data size change for oplog deletes can overflow 32-bit int (cherry picked from commit 2a11d0957b397e2c9bcb4230da9d764b50aaac3b)
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp6
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
index 1c3991ef151..8be255c684c 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
@@ -959,7 +959,7 @@ void WiredTigerRecordStore::_changeNumRecords(OperationContext* txn, int64_t dif
class WiredTigerRecordStore::DataSizeChange : public RecoveryUnit::Change {
public:
- DataSizeChange(WiredTigerRecordStore* rs, int amount) : _rs(rs), _amount(amount) {}
+ DataSizeChange(WiredTigerRecordStore* rs, int64_t amount) : _rs(rs), _amount(amount) {}
virtual void commit() {}
virtual void rollback() {
_rs->_increaseDataSize(NULL, -_amount);
@@ -967,10 +967,10 @@ public:
private:
WiredTigerRecordStore* _rs;
- int _amount;
+ int64_t _amount;
};
-void WiredTigerRecordStore::_increaseDataSize(OperationContext* txn, int amount) {
+void WiredTigerRecordStore::_increaseDataSize(OperationContext* txn, int64_t amount) {
if (txn)
txn->recoveryUnit()->registerChange(new DataSizeChange(this, amount));
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h
index faf5fbc7976..817fbdd1fa8 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h
@@ -269,7 +269,7 @@ private:
void _setId(RecordId loc);
bool cappedAndNeedDelete() const;
void _changeNumRecords(OperationContext* txn, int64_t diff);
- void _increaseDataSize(OperationContext* txn, int amount);
+ void _increaseDataSize(OperationContext* txn, int64_t amount);
RecordData _getData(const WiredTigerCursor& cursor) const;
StatusWith<RecordId> extractAndCheckLocForOplog(const char* data, int len);
void _oplogSetStartHack(WiredTigerRecoveryUnit* wru) const;