code: func maybeRunCompaction(dbname string, db *leveldb.DB) error {
  	val, err := db.GetProperty("leveldb.num-files-at-level0")
  	if err != nil {
  		return fmt.Errorf("could not get number of level-0 files of %v's LevelDB: %v", dbname, err)
  	}
  	nbFiles, err := strconv.Atoi(val)
  	if err != nil {
  		return fmt.Errorf("could not convert number of level-0 files to int: %v", err)
  	}
  	// Only force compaction if we're at the default trigger (4), see
  	// github.com/syndtr/goleveldb/leveldb/opt.DefaultCompactionL0Trigger
  	if nbFiles < 4 {
  		return nil
  	}
  	if err := db.CompactRange(util.Range{nil, nil}); err != nil {
  		return fmt.Errorf("could not run compaction on %v's LevelDB: %v", dbname, err)
  	}
  	return nil
  }
docs: // maybeRunCompaction forces compaction of db, if the number of
  // tables in level 0 is >= 4. dbname should be provided for error messages.