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

Drop indexes in progress. #354

Merged
merged 4 commits into from
Sep 7, 2018
Merged

Drop indexes in progress. #354

merged 4 commits into from
Sep 7, 2018

Conversation

kuba--
Copy link
Contributor

@kuba-- kuba-- commented Sep 6, 2018

Signed-off-by: kuba-- kuba@sourced.tech
Closes #343

Changes:
Right now we can drop/cancel indexes in progress.
Function IndexesByTable returns all indexes (NotReady as well), so if you want to know status you have to call CanUseIndex.
Delete index uses force flag (what cancel the context what breaks and deletes the index).
SHOW INDEX FROM... shows all indexes, but NotReady indexes have NO in column Visible, otherwise YES.

Signed-off-by: kuba-- <kuba@sourced.tech>
@kuba-- kuba-- added enhancement New feature or request proposal proposal for new additions or changes labels Sep 6, 2018
@kuba-- kuba-- requested review from erizocosmico and a team September 6, 2018 22:22
}

return idx
return r.indexes[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.

if we remove this, can't queries use indexes while it's still being created?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fine. I've double checked it. For regular queries we use IndexByExpression function where we still have the check:

		if !r.canUseIndex(idx) {
			continue
		}

Signed-off-by: kuba-- <kuba@sourced.tech>
@ajnavarro
Copy link
Contributor

kuba-- added 2 commits September 7, 2018 16:21
Signed-off-by: kuba-- <kuba@sourced.tech>
Signed-off-by: kuba-- <kuba@sourced.tech>
@kuba--
Copy link
Contributor Author

kuba-- commented Sep 7, 2018

@ajnavarro - I've added TestDeleteInProgress where I delete an index with two expressions during Save.

@ajnavarro ajnavarro merged commit 56886a2 into src-d:master Sep 7, 2018
@kuba-- kuba-- deleted the enh-343/cancel_by_drop branch September 7, 2018 17:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request proposal proposal for new additions or changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants