Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util/config: fix #1956 config error printing #1957

Merged
merged 5 commits into from
Jun 24, 2017

Conversation

andelf
Copy link
Contributor

@andelf andelf commented Jun 22, 2017

@andelf andelf requested a review from zhangjinpeng87 June 22, 2017 04:52
"no" => Ok(DBCompressionType::DBNo),
"snappy" => Ok(DBCompressionType::DBSnappy),
"zlib" => Ok(DBCompressionType::DBZlib),
"bzip2" => Ok(DBCompressionType::DBBz2),
"lz4" => Ok(DBCompressionType::DBLz4),
"lz4hc" => Ok(DBCompressionType::DBLz4hc),
_ => Err(ConfigError::RocksDB),
"zstd" => Ok(DBCompressionType::DBZstd),
v => Err(ConfigError::Value(format!("cannot parse {:?} as a compression type", v))),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"invalid compression type {:?}"

Copy link
Contributor

@siddontang siddontang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM


Ok(result)
tp.split(':')
.map(parse_rocksdb_compression)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't compile. And format is broken.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?????

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a mistake, it should be fine here.

@siddontang
Copy link
Contributor

PTAL @BusyJay

Copy link
Member

@BusyJay BusyJay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM

"no" => Ok(DBCompressionType::DBNo),
"snappy" => Ok(DBCompressionType::DBSnappy),
"zlib" => Ok(DBCompressionType::DBZlib),
"bzip2" => Ok(DBCompressionType::DBBz2),
"lz4" => Ok(DBCompressionType::DBLz4),
"lz4hc" => Ok(DBCompressionType::DBLz4hc),
_ => Err(ConfigError::RocksDB),
"zstd" => Ok(DBCompressionType::DBZstd),
v => Err(ConfigError::Value(format!("invalid compression type {:?}", v))),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use tp instead of v.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reject.
won't fix and will wait all other vs in codebase.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v is a temporary variable during processing, using tp is more clear and straight forward for user. You can raise a pr to clean up all the other places. But since this pr is about to fix error printing, so it's fine to fix them all in this pr too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any update here?

Maybe we can keep it for now and use another PR to clean up all?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checked out the diff, places need to be changed are L54 and L128, all are introduced in this pr.

@siddontang
Copy link
Contributor

Ping @andelf

@siddontang
Copy link
Contributor

PTAL @BusyJay

@BusyJay
Copy link
Member

BusyJay commented Jun 24, 2017

LGTM

@siddontang siddontang merged commit 2d107a8 into tikv:master Jun 24, 2017
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

un-meaningful rocksdb panic error
5 participants