diff --git a/sstable/colblk_writer.go b/sstable/colblk_writer.go index 5e35eb4740..83360bce5b 100644 --- a/sstable/colblk_writer.go +++ b/sstable/colblk_writer.go @@ -534,8 +534,13 @@ func (w *RawColumnWriter) evaluatePoint( if !w.disableKeyOrderChecks && (eval.kcmp.UserKeyComparison < 0 || (eval.kcmp.UserKeyComparison == 0 && w.prevPointKey.trailer <= key.Trailer)) { + previousKey := base.InternalKey{ + UserKey: w.dataBlock.MaterializeLastUserKey(nil), + Trailer: w.prevPointKey.trailer, + } return eval, errors.Errorf( - "pebble: keys must be added in strictly increasing order: %s", + "pebble: keys must be added in strictly increasing order: %s, %s", + previousKey.Pretty(w.comparer.FormatKey), key.Pretty(w.comparer.FormatKey)) } diff --git a/sstable/testdata/writer_v5 b/sstable/testdata/writer_v5 index f825bdb95c..ba21bae17e 100644 --- a/sstable/testdata/writer_v5 +++ b/sstable/testdata/writer_v5 @@ -142,13 +142,13 @@ build a.SET.1:b a.SET.2:c ---- -pebble: keys must be added in strictly increasing order: a#2,SET +pebble: keys must be added in strictly increasing order: a#1,SET, a#2,SET build b.SET.1:a a.SET.2:b ---- -pebble: keys must be added in strictly increasing order: a#2,SET +pebble: keys must be added in strictly increasing order: b#1,SET, a#2,SET build b.RANGEDEL.1:c