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

[ALLUXIO-3167] Allow application level TTL #7317

Merged
merged 13 commits into from
Jun 18, 2018
Merged

Conversation

Reidddddd
Copy link
Contributor

History:
Fix checkstyle warning
Move read ttl and ttlAction into CommonOptions
Use default free implementation temporarily

@alluxio-bot
Copy link
Contributor

Automated checks report:

Please fix the reported issues and reply 'alluxio-bot, check this please' to re-run checks

@AmplabJenkins
Copy link

Merged build finished. Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-Pull-Request-Builder/19721/
Test FAILed.

@AmplabJenkins
Copy link

Merged build finished. Test FAILed.

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-Pull-Request-Builder/19724/
Test PASSed.

@Reidddddd
Copy link
Contributor Author

ping @apc999 @aaudiber

Copy link
Contributor

@apc999 apc999 left a comment

Choose a reason for hiding this comment

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

Minor comments left. Otherwise this PR looks good. Thanks for the improvement! @Reidddddd

@@ -2282,6 +2293,17 @@ public String toString() {
.setConsistencyCheckLevel(ConsistencyCheckLevel.WARN)
.setScope(Scope.CLIENT)
.build();
public static final PropertyKey USER_FILE_WRITE_CACHE_TTL_MS =
Copy link
Contributor

Choose a reason for hiding this comment

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

Naming suggestion: USER_FILE_WRITE_CACHE_TTL.
We don't suffix _MS now for new configuraitons as Alluxio conf can support TTL values like "1d", "2minute", not necessary to be is unit of ms.

5: optional i64 ttl
6: optional common.TTtlAction ttlAction
7: optional FileSystemMasterCommonTOptions commonOptions
5: optional FileSystemMasterCommonTOptions commonOptions
Copy link
Contributor

Choose a reason for hiding this comment

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

to keep backward compatibility, still have commonOptions with index 7 and let's not remove index 5 and 6 but simply rename them and comment the deprecation.

5: optional i64 ttlNotUsed // deprecated from 1.8
6: optional common.TTtlAction ttlActionNotUsed // deprecated from 1.8
7: optional FileSystemMasterCommonTOptions commonOptions

5: optional i16 mode
6: optional common.TTtlAction ttlAction
7: optional FileSystemMasterCommonTOptions commonOptions
4: optional i16 mode
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

getCommonOptions().setTtlAction(ttlAction);
return getThis();
}

@Override
public boolean equals(Object o) {
Copy link
Contributor

Choose a reason for hiding this comment

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

update this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean the equals() method?
Since Ttl and TtlAction are included in CommonOptions, this equals should be fine?

Copy link
Contributor

Choose a reason for hiding this comment

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

ack

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-Pull-Request-Builder/19883/
Test PASSed.

Copy link
Contributor

@apc999 apc999 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for this improvement!

@apc999
Copy link
Contributor

apc999 commented Jun 1, 2018

@aaudiber , are we good to merge this PR?

@aaudiber
Copy link
Contributor

aaudiber commented Jun 1, 2018

@calvinjia mentioned that he wanted a chance to look at this before it goes in, lets give him a chance to chime in

Copy link
Contributor

@aaudiber aaudiber left a comment

Choose a reason for hiding this comment

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

Looks good overall, left some questions and comments about property names

@@ -2282,6 +2293,17 @@ public String toString() {
.setConsistencyCheckLevel(ConsistencyCheckLevel.WARN)
.setScope(Scope.CLIENT)
.build();
public static final PropertyKey USER_FILE_WRITE_CACHE_TTL =
new Builder(Name.USER_FILE_WRITE_CACHE_TTL)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this apply to non-cache writes using THROUGH or CACHE_THROUGH write types? If so we should remove the "cache" part

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 that

public static final PropertyKey USER_FILE_READ_CACHE_TTL_EXPIRED_ACTION =
new Builder(Name.USER_FILE_READ_CACHE_TTL_EXPIRED_ACTION)
.setDefaultValue("DELETE")
.setDescription("When file's ttl is expired, the action performs on it."
Copy link
Contributor

Choose a reason for hiding this comment

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

If I have a file "/file" only in the UFS, then Alluxio discovers it with TTL=1hour, TTL_ACTION=delete, does that mean that we'll delete the file from the UFS after 1 hour?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, i think so.

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 think write type THROUGH is the case as you described.

.setDescription("Time to live for files loaded from UFS by a user, no ttl by default.")
.build();
public static final PropertyKey USER_FILE_READ_CACHE_TTL_EXPIRED_ACTION =
new Builder(Name.USER_FILE_READ_CACHE_TTL_EXPIRED_ACTION)
Copy link
Contributor

Choose a reason for hiding this comment

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

we call it TTL_ACTION in other places, good to stay consistent

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 that

@@ -2253,6 +2253,17 @@ public String toString() {
.setConsistencyCheckLevel(ConsistencyCheckLevel.WARN)
.setScope(Scope.CLIENT)
.build();
public static final PropertyKey USER_FILE_READ_CACHE_TTL =
new Builder(Name.USER_FILE_READ_CACHE_TTL)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this applies only to newly loaded files, not just and read files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is USER_FILE_LOAD_TTL good, remove "CACHE" as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we use LOAD, is it ok to rename "WRITE" to "CREATE". I think it should try to keep symmetrical, like WRITE <-> READ, CREATE <-> LOAD.

@AmplabJenkins
Copy link

Merged build finished. Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-Pull-Request-Builder/19960/

Failed Tests: 1

org.alluxio:alluxio-tests: 1


Test FAILed.

@Reidddddd
Copy link
Contributor Author

Reidddddd commented Jun 5, 2018

How to trigger jenkins again?
{java.lang.RuntimeException: Timed out waiting for Alluxio worker to start}
It seems unrelated, but i'm not sure.

@aaudiber
Copy link
Contributor

aaudiber commented Jun 5, 2018

Jenkins, test this please

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@Reidddddd
Copy link
Contributor Author

Reidddddd commented Jun 8, 2018

Could you add documentation detailing how to manipulate TTL after this feature is added?

I think it is just like other user configurations. And i think @apc999's post [How to configure]
(https://zhuanlan.zhihu.com/p/35255287) it is pretty good and much more general and should be posted on official site.

I suggest changing the name from WRITE to CREATE

Agree, as i mentioned.

Taking it a step further, do you think there is value in differentiating between creating a new path in Alluxio vs loading one from the under storage?

Creating and loading or writing and reading often has different scenarios based on need, i tend to keep this flexibility.

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-Pull-Request-Builder/20043/
Test PASSed.

@calvinjia
Copy link
Contributor

@Reidddddd Thanks for the update, I have two follow up comments

  1. Could you change the default TTL behavior to FREE? It would be unfortunate if the user set the default TTL time but not the behavior and lost data.
  2. The TTL changes only take into effect when we are surfacing new files from the under storage (ie. load metadata) or creating new paths (mkdir, create). To me these seem like the same concept and shouldn't need to be differentiated by two configurations. I would agree if there was a separate configuration for changing the TTL on any read request.

@Reidddddd
Copy link
Contributor Author

Reidddddd commented Jun 12, 2018

Could you change the default TTL behavior to FREE? It would be unfortunate if the user set the default TTL time but not the behavior and lost data.

Exactly, i suffered this once in production :(. And this is what i'm going to do in next jira(at least two up coming, but are blocked by this pr), just don't like squeeze too many modifications in one pull request.

To me these seem like the same concept and shouldn't need to be differentiated by two configurations.

On concept, no argument. But for specific scenario, like writing, a user may want to keep important files without ttl, writing is not like reading whose data are persisted in UFS.

A general application always contains both read and write scenario, still don't think it a good idea to merge into one.

@calvinjia
Copy link
Contributor

@Reidddddd Sure, could you point me to the other JIRA tickets you are planning to address?

@Reidddddd
Copy link
Contributor Author

@aaudiber
Copy link
Contributor

@Reidddddd can you resolve the conflict with master? After that I think this PR is good to go

@Reidddddd
Copy link
Contributor Author

sure, please wait.

@AmplabJenkins
Copy link

Merged build finished. Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-Pull-Request-Builder/20204/

Failed Tests: 1

org.alluxio:alluxio-core-server-master: 1


Test FAILed.

@Reidddddd
Copy link
Contributor Author

CreateDirectoryOptions{commonOptions=null, mountPoint=true, operationTimeMs=40, owner=null, group=null, mode=null, persisted=true, recursive=true, metadataLoad=true, allowExists=true} [group 1, item 1] must not be Object#equals to
CreateDirectoryOptions{commonOptions=null, mountPoint=true, operationTimeMs=40, owner=null, group=null, mode=null, persisted=true, recursive=true, metadataLoad=true, allowExists=true} [group 3, item 1]

except [group 1, item 1] and [group 3, item 1]?

@Reidddddd
Copy link
Contributor Author

Jenkins, test this please

@AmplabJenkins
Copy link

Merged build finished. Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-Pull-Request-Builder/20207/

Failed Tests: 1

org.alluxio:alluxio-core-server-master: 1


Test FAILed.

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-Pull-Request-Builder/20212/
Test PASSed.

@apc999 apc999 merged commit 8b5afeb into Alluxio:master Jun 18, 2018
@Reidddddd Reidddddd deleted the alluxio branch June 19, 2018 15:25
aaudiber pushed a commit to aaudiber/alluxio that referenced this pull request Jun 20, 2018
* [ALLUXIO-3167] Allow application level TTL

* ALLUXIO-3167 Fix checkstyle warning

* Move read ttl and ttlAction into CommonOptions

* Use default free implementation temporarily

* Fix CommonOptions's checkstyle

* Missed a )

* Since CommonOptions has ttl and ttlAction, remove duplicate ttl and ttlAction arguments

* Remove _MS suffix and revert thrift protocol for backward compatibility

* Property name: remove 'cache', rename 'read' to 'load', use 'ttl action'

* Add space between sentences

* Rename '_WRITE_' to '_CREATE_'

* Add UfsStatus in CreateDirectoryOptions's equals, hashCode and toString method
apc999 pushed a commit that referenced this pull request Jun 20, 2018
* [ALLUXIO-3167] Allow application level TTL

* ALLUXIO-3167 Fix checkstyle warning

* Move read ttl and ttlAction into CommonOptions

* Use default free implementation temporarily

* Fix CommonOptions's checkstyle

* Missed a )

* Since CommonOptions has ttl and ttlAction, remove duplicate ttl and ttlAction arguments

* Remove _MS suffix and revert thrift protocol for backward compatibility

* Property name: remove 'cache', rename 'read' to 'load', use 'ttl action'

* Add space between sentences

* Rename '_WRITE_' to '_CREATE_'

* Add UfsStatus in CreateDirectoryOptions's equals, hashCode and toString method
yuzhu pushed a commit to yuzhu/alluxio that referenced this pull request Jun 27, 2018
* [ALLUXIO-3167] Allow application level TTL

* ALLUXIO-3167 Fix checkstyle warning

* Move read ttl and ttlAction into CommonOptions

* Use default free implementation temporarily

* Fix CommonOptions's checkstyle

* Missed a )

* Since CommonOptions has ttl and ttlAction, remove duplicate ttl and ttlAction arguments

* Remove _MS suffix and revert thrift protocol for backward compatibility

* Property name: remove 'cache', rename 'read' to 'load', use 'ttl action'

* Add space between sentences

* Rename '_WRITE_' to '_CREATE_'

* Add UfsStatus in CreateDirectoryOptions's equals, hashCode and toString method
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.

6 participants