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

*: fix table namespace classifier. #808

Merged
merged 6 commits into from
Oct 20, 2017
Merged

Conversation

disksing
Copy link
Contributor

  1. GetAllNamespaces should contain DefaultNamespace, or the stores in default namespace will not be balanced.
  2. _ IsPureTableID_ need decode the key before check if it is table prefix.

@disksing disksing requested review from dantin and nolouch October 19, 2017 06:21
table/codec.go Outdated
@@ -84,7 +84,11 @@ func decodeCmpUintToInt(u uint64) int64 {

// IsPureTableID return true iff b is consist of tablePrefix and 8-byte tableID
Copy link
Contributor

Choose a reason for hiding this comment

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

s/iff/if

Copy link
Contributor

@nolouch nolouch 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

@@ -82,9 +82,13 @@ func decodeCmpUintToInt(u uint64) int64 {
return int64(u ^ signMask)
}

// IsPureTableID return true iff b is consist of tablePrefix and 8-byte tableID
// IsPureTableID returns true if b is consist of tablePrefix and 8-byte tableID
func IsPureTableID(b []byte) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

please add test

@@ -123,6 +123,7 @@ func (c *tableNamespaceClassifier) GetAllNamespaces() []string {
for name := range c.nsInfo.namespaces {
nsList = append(nsList, name)
}
nsList = append(nsList, namespace.DefaultNamespace)
Copy link
Contributor

Choose a reason for hiding this comment

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

need to check duplicated default here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe forbid creating namespace using global instead.

@nolouch nolouch mentioned this pull request Oct 19, 2017
@siddontang
Copy link
Contributor

LGTM

@nolouch nolouch merged commit f5f0b20 into tikv:master Oct 20, 2017
@disksing disksing deleted the namespace branch October 23, 2017 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants