From 4329d74e0581fa6ade91733643803f9ea3716743 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Thu, 4 Sep 2014 20:09:45 -0700 Subject: [PATCH 1/2] Fix swapped variable names to accurately reflect usage --- db/version_edit.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/version_edit.h b/db/version_edit.h index 58edfed45..db133402c 100644 --- a/db/version_edit.h +++ b/db/version_edit.h @@ -163,13 +163,13 @@ class VersionEdit { // Add the specified file at the specified number. // REQUIRES: This version has not been saved (see VersionSet::SaveTo) // REQUIRES: "smallest" and "largest" are smallest and largest keys in file - void AddFile(int level, uint64_t file, uint64_t file_size, - uint64_t file_path_id, const InternalKey& smallest, + void AddFile(int level, uint64_t file, uint64_t file_path_id, + uint64_t file_size, const InternalKey& smallest, const InternalKey& largest, const SequenceNumber& smallest_seqno, const SequenceNumber& largest_seqno) { assert(smallest_seqno <= largest_seqno); FileMetaData f; - f.fd = FileDescriptor(file, file_size, file_path_id); + f.fd = FileDescriptor(file, file_path_id, file_size); f.smallest = smallest; f.largest = largest; f.smallest_seqno = smallest_seqno; From 0cd0ec4fe0d3bca14431766674a3382b83993bd9 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Thu, 4 Sep 2014 20:52:00 -0700 Subject: [PATCH 2/2] Plug memory leak during index creation --- utilities/document/document_db.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/utilities/document/document_db.cc b/utilities/document/document_db.cc index c12a1f253..8e15a52ca 100644 --- a/utilities/document/document_db.cc +++ b/utilities/document/document_db.cc @@ -736,6 +736,7 @@ class DocumentDBImpl : public DocumentDB { CreateColumnFamily(ColumnFamilyOptions(rocksdb_options_), InternalSecondaryIndexName(index.name), &cf_handle); if (!s.ok()) { + delete index_obj; return s; }