code: def estimate_size_in_bytes(cls, magic, compression_type, key, value):
          
          assert magic in [0, 1], "Not supported magic"
          # In case of compression we may need another overhead for inner msg
          if compression_type:
              return (
                  cls.LOG_OVERHEAD + cls.record_overhead(magic) +
                  cls.record_size(magic, key, value)
              )
          return cls.LOG_OVERHEAD + cls.record_size(magic, key, value)
docs: Upper bound estimate of record size.