-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Conversation
Automated checks report:
Please fix the reported issues and reply 'alluxio-bot, check this please' to re-run checks |
Merged build finished. Test FAILed. |
Test FAILed. |
Merged build finished. Test FAILed. |
…tlAction arguments
Merged build finished. Test PASSed. |
Test PASSed. |
There was a problem hiding this 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 = |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update this method?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
Merged build finished. Test PASSed. |
Test PASSed. |
There was a problem hiding this 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!
@aaudiber , are we good to merge this PR? |
@calvinjia mentioned that he wanted a chance to look at this before it goes in, lets give him a chance to chime in |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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." |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, i think so.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Merged build finished. Test FAILed. |
Test FAILed. Failed Tests: 1org.alluxio:alluxio-tests: 1Test FAILed. |
How to trigger jenkins again? |
Jenkins, test this please |
Merged build finished. Test PASSed. |
I think it is just like other user configurations. And i think @apc999's post [How to configure]
Agree, as i mentioned.
Creating and loading or writing and reading often has different scenarios based on need, i tend to keep this flexibility. |
Merged build finished. Test PASSed. |
Test PASSed. |
@Reidddddd Thanks for the update, I have two follow up comments
|
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.
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. |
@Reidddddd Sure, could you point me to the other JIRA tickets you are planning to address? |
FYI https://alluxio.atlassian.net/browse/ALLUXIO-3222 @calvinjia |
@Reidddddd can you resolve the conflict with master? After that I think this PR is good to go |
sure, please wait. |
Merged build finished. Test FAILed. |
Test FAILed. Failed Tests: 1org.alluxio:alluxio-core-server-master: 1Test FAILed. |
except [group 1, item 1] and [group 3, item 1]? |
Jenkins, test this please |
Merged build finished. Test FAILed. |
Test FAILed. Failed Tests: 1org.alluxio:alluxio-core-server-master: 1Test FAILed. |
Merged build finished. Test PASSed. |
Test PASSed. |
* [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
* [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
* [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
History:
Fix checkstyle warning
Move read ttl and ttlAction into CommonOptions
Use default free implementation temporarily