Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Support TTL for index #382

Merged
merged 7 commits into from
Apr 12, 2021

Conversation

bright-starry-sky
Copy link
Contributor

Not ready to review

@bright-starry-sky bright-starry-sky added the wip Solution: work in progress label Mar 10, 2021
@bright-starry-sky bright-starry-sky added ready-for-testing PR: ready for the CI test doc affected Solution: improvements or additions to documentation and removed wip Solution: work in progress labels Mar 23, 2021
@bright-starry-sky
Copy link
Contributor Author

TODO :

  1. test cases for storage side.
  2. correct test cases for graph side.

@bright-starry-sky
Copy link
Contributor Author

Added test cases for storage side.

@bright-starry-sky
Copy link
Contributor Author

test cases changed for graph side :
vesoft-inc/nebula-graph#876

@bright-starry-sky
Copy link
Contributor Author

Ready to review.

@CLAassistant
Copy link

CLAassistant commented Mar 26, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@critical27 critical27 left a comment

Choose a reason for hiding this comment

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

LGTM, good job. Any related PR?

@bright-starry-sky
Copy link
Contributor Author

bright-starry-sky commented Mar 29, 2021

LGTM, good job. Any related PR?

After this one merged , test case need to correct for graph side : vesoft-inc/nebula-graph#876

critical27
critical27 previously approved these changes Mar 29, 2021

StatusOr<Value> CommonUtils::ttlValue(const meta::SchemaProviderIf* schema, RowReader* reader) {
DCHECK(schema != nullptr);
const auto* ns = dynamic_cast<const meta::NebulaSchemaProvider*>(schema);
Copy link
Contributor

Choose a reason for hiding this comment

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

We could remove SchemaProviderIf later if necessary, it is useless now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could remove SchemaProviderIf later if necessary, it is useless now.

Yes, I see other place that need to be changed, Let me change them later.

continue;
}

auto ttlProp = CommonUtils::ttlProps(schema.get());
Copy link
Contributor

Choose a reason for hiding this comment

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

Could move to rebuild index task ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could move to rebuild index task ?

What's the purpose?

@bright-starry-sky
Copy link
Contributor Author

Fixed compile error and rebased master.

critical27
critical27 previously approved these changes Apr 2, 2021
if (prop.get_ttl_col()) {
col = *prop.get_ttl_col();
}
if (!col.empty() && duration > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can ttl and index coexist?

Copy link
Contributor Author

@bright-starry-sky bright-starry-sky Apr 6, 2021

Choose a reason for hiding this comment

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

Aha, they can coexist. I saved the timestamp value to index val.

Copy link
Contributor

Choose a reason for hiding this comment

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

existIndex means there is an index,
!col.empty() && duration> 0 means there is ttl

Why is there an error 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.

existIndex means there is an index,
!col.empty() && duration> 0 means there is ttl

Why is there an error here?

if index exists, not allow to alter TTL properties.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, i know what you mean.
But the prop schema prop is in the schema, not the schema prop in AlterTagReq.

Your current logic is that when alter tag, as long as there is index and ttl, an error will be reported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, i know what you mean.
But the prop schema prop is in the schema, not the schema prop in AlterTagReq.

Your current logic is that when alter tag, as long as there is index and ttl, an error will be reported.

yes,there should be an error thrown here, either alter ttl or alter column (excepted for add column )

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean:
here logic is unreasonable.
As long as there are index and ttl, here are not allowed to alter tag

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean:
here logic is unreasonable.
As long as there are index and ttl, here are not allowed to alter tag

good point. 🐂B
artimg

Copy link
Contributor

@panda-sheep panda-sheep left a comment

Choose a reason for hiding this comment

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

Good job.
could you add a UT that a tag has already a index and ttl, and then alter this tag(not alter ttl prop)?

@bright-starry-sky
Copy link
Contributor Author

Good job.
could you add a UT that a tag has already a index and ttl, and then alter this tag(not alter ttl prop)?

Aha, the old test cases are still valid for storage side. for graph side, the below PR to do with what you said.

@bright-starry-sky
Copy link
Contributor Author

Good job.
could you add a UT that a tag has already a index and ttl, and then alter this tag(not alter ttl prop)?

Aha, the old test cases are still valid for storage side. for graph side, the below PR to do with what you said.

vesoft-inc/nebula-graph#876

@bright-starry-sky
Copy link
Contributor Author

Addressed panda-sheep's comments.

Copy link
Contributor

@panda-sheep panda-sheep left a comment

Choose a reason for hiding this comment

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

Good job!

Copy link
Contributor

@critical27 critical27 left a comment

Choose a reason for hiding this comment

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

Good job!

@bright-starry-sky
Copy link
Contributor Author

This file src/meta/test/ProcessorTest.cpp is too large and often causes the link to fail on CI system (ubuntu1804, gcc-9.2).
I'm going to split it in the next PR.

@bright-starry-sky bright-starry-sky merged commit b2851b4 into vesoft-inc:master Apr 12, 2021
@bright-starry-sky bright-starry-sky deleted the index_ttl branch April 12, 2021 07:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
doc affected Solution: improvements or additions to documentation ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants