Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

sql/*: implement drop index statement #183

Merged
merged 1 commit into from
Jun 15, 2018

Conversation

erizocosmico
Copy link
Contributor

Depends on #182

Closes #172

@ajnavarro
Copy link
Contributor

could you rebase this one too @erizocosmico ?

@erizocosmico
Copy link
Contributor Author

Sure

@erizocosmico
Copy link
Contributor Author

Fixed @ajnavarro

sql/index.go Outdated
@@ -206,6 +209,8 @@ func (r *IndexRegistry) ReleaseIndex(idx Index) {
func (r *IndexRegistry) Index(db, id string) Index {
r.mut.RLock()
defer r.mut.RUnlock()
r.retainIndex(db, id)
fmt.Println(indexKey{db, strings.ToLower(id)})
Copy link
Contributor

Choose a reason for hiding this comment

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

leftover?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

return nil, ErrInvalidIndexDriver.New(index.Driver())
}

go func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we block until the index is deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It depends. Do we want to make the user wait until it's deleted or succeed and asynchronously delete the index?

Copy link
Contributor

Choose a reason for hiding this comment

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

on index deletion (that shouldn't take A LOT) I think we should wait until the index is dropped, or throw an error otherwise. WDYT @kuba-- ?

Copy link
Contributor

Choose a reason for hiding this comment

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

delete index is/should be super fast (basically it deletes directory). so far it also sends delete to pilosa synchronously (because i didn't notice any lag), but If we encounter any issues we can async. call pilosa). Just to recap, it's totally fine to delete just directory. Pilosa bitmap can be deleted any time or even overwritten.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, lets block and wait if we get an error

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, lets block and wait if we get an error

@erizocosmico erizocosmico force-pushed the feature/drop-index branch 2 times, most recently from fb811d8 to a1ee88e Compare June 6, 2018 15:22
@erizocosmico
Copy link
Contributor Author

Done @ajnavarro @kuba--

@erizocosmico
Copy link
Contributor Author

Rebased. Any else left so we can merge this, @kuba--?

Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
@kuba-- kuba-- self-requested a review June 15, 2018 08:12
@kuba--
Copy link
Contributor

kuba-- commented Jun 15, 2018

LGTM

@ajnavarro ajnavarro merged commit 3b20601 into src-d:master Jun 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants