Hello community, here is the log from the commit of package leveldb for openSUSE:Factory checked in at 2014-04-09 13:14:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/leveldb (Old) and /work/SRC/openSUSE:Factory/.leveldb.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "leveldb" Changes: -------- --- /work/SRC/openSUSE:Factory/leveldb/leveldb.changes 2014-02-12 20:53:52.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.leveldb.new/leveldb.changes 2014-04-09 13:14:11.000000000 +0200 @@ -1,0 +2,9 @@ +Mon Apr 7 15:33:22 UTC 2014 - dd...@suse.com + +- updated to 1.16.0 + + Make Log::Reader not report a corruption when the last record in a + log file is truncated. + + Fix issue 224: variable created but not utilized. + + Remove comment that referenced a removed feature. + +------------------------------------------------------------------- Old: ---- leveldb-1.15.0.tar.gz New: ---- leveldb-1.16.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ leveldb.spec ++++++ --- /var/tmp/diff_new_pack.tSbjXD/_old 2014-04-09 13:14:12.000000000 +0200 +++ /var/tmp/diff_new_pack.tSbjXD/_new 2014-04-09 13:14:12.000000000 +0200 @@ -17,13 +17,13 @@ Name: leveldb -Version: 1.15.0 +Version: 1.16.0 Release: 0 Summary: A key/value-store License: BSD-3-Clause Group: Development/Libraries/C and C++ Url: http://code.google.com/p/leveldb/ -Source: leveldb-%{version}.tar.gz +Source: leveldb-%{version}.tar.bz2 Patch0: 0001-debian-ports.patch BuildRequires: gcc-c++ BuildRequires: snappy-devel ++++++ leveldb-1.15.0.tar.gz -> leveldb-1.16.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leveldb-1.15.0/Makefile new/leveldb-1.16.0/Makefile --- old/leveldb-1.15.0/Makefile 2013-12-10 20:15:00.000000000 +0100 +++ new/leveldb-1.16.0/Makefile 2014-02-10 20:36:06.000000000 +0100 @@ -72,7 +72,7 @@ else # Update db.h if you change these. SHARED_MAJOR = 1 -SHARED_MINOR = 15 +SHARED_MINOR = 16 SHARED1 = libleveldb.$(PLATFORM_SHARED_EXT) SHARED2 = $(SHARED1).$(SHARED_MAJOR) SHARED3 = $(SHARED1).$(SHARED_MAJOR).$(SHARED_MINOR) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leveldb-1.15.0/db/log_reader.cc new/leveldb-1.16.0/db/log_reader.cc --- old/leveldb-1.15.0/db/log_reader.cc 2013-12-10 20:15:01.000000000 +0100 +++ new/leveldb-1.16.0/db/log_reader.cc 2014-02-10 20:36:06.000000000 +0100 @@ -133,7 +133,9 @@ case kEof: if (in_fragmented_record) { - ReportCorruption(scratch->size(), "partial record without end(3)"); + // This can be caused by the writer dying immediately after + // writing a physical record but before completing the next; don't + // treat it as a corruption, just ignore the entire logical record. scratch->clear(); } return false; @@ -193,13 +195,12 @@ eof_ = true; } continue; - } else if (buffer_.size() == 0) { - // End of file - return kEof; } else { - size_t drop_size = buffer_.size(); + // Note that if buffer_ is non-empty, we have a truncated header at the + // end of the file, which can be caused by the writer crashing in the + // middle of writing the header. Instead of considering this an error, + // just report EOF. buffer_.clear(); - ReportCorruption(drop_size, "truncated record at end of file"); return kEof; } } @@ -213,8 +214,14 @@ if (kHeaderSize + length > buffer_.size()) { size_t drop_size = buffer_.size(); buffer_.clear(); - ReportCorruption(drop_size, "bad record length"); - return kBadRecord; + if (!eof_) { + ReportCorruption(drop_size, "bad record length"); + return kBadRecord; + } + // If the end of the file has been reached without reading |length| bytes + // of payload, assume the writer died in the middle of writing the record. + // Don't report a corruption. + return kEof; } if (type == kZeroType && length == 0) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leveldb-1.15.0/db/log_test.cc new/leveldb-1.16.0/db/log_test.cc --- old/leveldb-1.15.0/db/log_test.cc 2013-12-10 20:15:01.000000000 +0100 +++ new/leveldb-1.16.0/db/log_test.cc 2014-02-10 20:36:06.000000000 +0100 @@ -351,20 +351,32 @@ ASSERT_EQ("OK", MatchError("unknown record type")); } -TEST(LogTest, TruncatedTrailingRecord) { +TEST(LogTest, TruncatedTrailingRecordIsIgnored) { Write("foo"); ShrinkSize(4); // Drop all payload as well as a header byte ASSERT_EQ("EOF", Read()); - ASSERT_EQ(kHeaderSize - 1, DroppedBytes()); - ASSERT_EQ("OK", MatchError("truncated record at end of file")); + // Truncated last record is ignored, not treated as an error. + ASSERT_EQ(0, DroppedBytes()); + ASSERT_EQ("", ReportMessage()); } TEST(LogTest, BadLength) { + const int kPayloadSize = kBlockSize - kHeaderSize; + Write(BigString("bar", kPayloadSize)); + Write("foo"); + // Least significant size byte is stored in header[4]. + IncrementByte(4, 1); + ASSERT_EQ("foo", Read()); + ASSERT_EQ(kBlockSize, DroppedBytes()); + ASSERT_EQ("OK", MatchError("bad record length")); +} + +TEST(LogTest, BadLengthAtEndIsIgnored) { Write("foo"); ShrinkSize(1); ASSERT_EQ("EOF", Read()); - ASSERT_EQ(kHeaderSize + 2, DroppedBytes()); - ASSERT_EQ("OK", MatchError("bad record length")); + ASSERT_EQ(0, DroppedBytes()); + ASSERT_EQ("", ReportMessage()); } TEST(LogTest, ChecksumMismatch) { @@ -415,6 +427,24 @@ ASSERT_EQ("OK", MatchError("partial record without end")); } +TEST(LogTest, MissingLastIsIgnored) { + Write(BigString("bar", kBlockSize)); + // Remove the LAST block, including header. + ShrinkSize(14); + ASSERT_EQ("EOF", Read()); + ASSERT_EQ("", ReportMessage()); + ASSERT_EQ(0, DroppedBytes()); +} + +TEST(LogTest, PartialLastIsIgnored) { + Write(BigString("bar", kBlockSize)); + // Cause a bad record length in the LAST block. + ShrinkSize(1); + ASSERT_EQ("EOF", Read()); + ASSERT_EQ("", ReportMessage()); + ASSERT_EQ(0, DroppedBytes()); +} + TEST(LogTest, ErrorJoinsRecords) { // Consider two fragmented records: // first(R1) last(R1) first(R2) last(R2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leveldb-1.15.0/db/repair.cc new/leveldb-1.16.0/db/repair.cc --- old/leveldb-1.15.0/db/repair.cc 2013-12-10 20:15:01.000000000 +0100 +++ new/leveldb-1.16.0/db/repair.cc 2014-02-10 20:36:06.000000000 +0100 @@ -242,7 +242,6 @@ } void ExtractMetaData() { - std::vector<TableInfo> kept; for (size_t i = 0; i < table_numbers_.size(); i++) { ScanTable(table_numbers_[i]); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leveldb-1.15.0/include/leveldb/c.h new/leveldb-1.16.0/include/leveldb/c.h --- old/leveldb-1.15.0/include/leveldb/c.h 2013-12-10 20:15:01.000000000 +0100 +++ new/leveldb-1.16.0/include/leveldb/c.h 2014-02-10 20:36:06.000000000 +0100 @@ -9,7 +9,6 @@ Does not support: . getters for the option types . custom comparators that implement key shortening - . capturing post-write-snapshot . custom iter, db, env, cache implementations using just the C bindings Some conventions: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leveldb-1.15.0/include/leveldb/db.h new/leveldb-1.16.0/include/leveldb/db.h --- old/leveldb-1.15.0/include/leveldb/db.h 2013-12-10 20:15:01.000000000 +0100 +++ new/leveldb-1.16.0/include/leveldb/db.h 2014-02-10 20:36:06.000000000 +0100 @@ -14,7 +14,7 @@ // Update Makefile if you change these static const int kMajorVersion = 1; -static const int kMinorVersion = 15; +static const int kMinorVersion = 16; struct Options; struct ReadOptions; -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org