You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (JIRA)" <ji...@apache.org> on 2012/05/10 20:42:51 UTC
[jira] [Created] (CASSANDRA-4237) Add back 0.8-style
memtable_lifetime feature
Jonathan Ellis created CASSANDRA-4237:
-----------------------------------------
Summary: Add back 0.8-style memtable_lifetime feature
Key: CASSANDRA-4237
URL: https://issues.apache.org/jira/browse/CASSANDRA-4237
Project: Cassandra
Issue Type: New Feature
Components: Core
Affects Versions: 1.0.0
Reporter: Jonathan Ellis
Assignee: Yuki Morishita
Priority: Minor
Fix For: 1.2
Back in 0.8 we had a memtable_lifetime_in_minutes setting. We got rid of it in 1.0 when we added CASSANDRA-2427, which is a better way to ensure flushing on low-activity memtables.
However, at the same time we also added the ability to disable durable writes. So it's entirely possible to configure a low-activity memtable, that isn't part of the commitlog. So, we should add back a memtable lifetime setting.
An additional motive is pointed out by http://www.fsl.cs.sunysb.edu/~pshetty/socc11-gtssl.pdf: if you have a *high* activity columnfamily, and don't require absolute durability, the commitlog is redundant if you are flushing faster than the commitlog sync period. So, disabling durable writes but setting memtable lifetime to the same as the commitlog sync would be a reasonable optimization.
Thus, when we add back memtable lifetime, I think we should measure it in seconds or possibly even milliseconds (to match commitlog_sync_period) rather than minutes.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-4237) Add back 0.8-style
memtable_lifetime feature
Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420671#comment-13420671 ]
Jonathan Ellis commented on CASSANDRA-4237:
-------------------------------------------
I don't think this is quite what we want, since it will flush the memtable every {{period}} regardless of whether it has already been recently flushed by normal request volume. (FWIW, the 0.8 brute force approach was to loop over each CFS in the KS every 10s, and flush it if it was expired -- see callers of CFS.forceFlushIfExpired.)
> Add back 0.8-style memtable_lifetime feature
> --------------------------------------------
>
> Key: CASSANDRA-4237
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4237
> Project: Cassandra
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Jonathan Ellis
> Assignee: Yuki Morishita
> Priority: Minor
> Fix For: 1.2
>
> Attachments: 4237.txt
>
>
> Back in 0.8 we had a memtable_lifetime_in_minutes setting. We got rid of it in 1.0 when we added CASSANDRA-2427, which is a better way to ensure flushing on low-activity memtables.
> However, at the same time we also added the ability to disable durable writes. So it's entirely possible to configure a low-activity memtable, that isn't part of the commitlog. So, we should add back a memtable lifetime setting.
> An additional motive is pointed out by http://www.fsl.cs.sunysb.edu/~pshetty/socc11-gtssl.pdf: if you have a *high* activity columnfamily, and don't require absolute durability, the commitlog is redundant if you are flushing faster than the commitlog sync period. So, disabling durable writes but setting memtable lifetime to the same as the commitlog sync would be a reasonable optimization.
> Thus, when we add back memtable lifetime, I think we should measure it in seconds or possibly even milliseconds (to match commitlog_sync_period) rather than minutes.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-4237) Add back 0.8-style
memtable_lifetime feature
Posted by "Yuki Morishita (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yuki Morishita updated CASSANDRA-4237:
--------------------------------------
Attachment: 4237.txt
Attaching rebased and updated version.
bq. is there a race here where if user manually calls force flush while it's expired, we get two scheduled tasks added?
You are right, so I moved the rescheduling code from forceFlush to scheduleFlush. I just let periodic flush to be scheduled without canceling already scheduled ones, and let the task check expiration before running flush.
> Add back 0.8-style memtable_lifetime feature
> --------------------------------------------
>
> Key: CASSANDRA-4237
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4237
> Project: Cassandra
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Jonathan Ellis
> Assignee: Yuki Morishita
> Priority: Minor
> Fix For: 1.2.0
>
> Attachments: 4237.txt
>
>
> Back in 0.8 we had a memtable_lifetime_in_minutes setting. We got rid of it in 1.0 when we added CASSANDRA-2427, which is a better way to ensure flushing on low-activity memtables.
> However, at the same time we also added the ability to disable durable writes. So it's entirely possible to configure a low-activity memtable, that isn't part of the commitlog. So, we should add back a memtable lifetime setting.
> An additional motive is pointed out by http://www.fsl.cs.sunysb.edu/~pshetty/socc11-gtssl.pdf: if you have a *high* activity columnfamily, and don't require absolute durability, the commitlog is redundant if you are flushing faster than the commitlog sync period. So, disabling durable writes but setting memtable lifetime to the same as the commitlog sync would be a reasonable optimization.
> Thus, when we add back memtable lifetime, I think we should measure it in seconds or possibly even milliseconds (to match commitlog_sync_period) rather than minutes.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-4237) Add back 0.8-style
memtable_lifetime feature
Posted by "Yuki Morishita (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yuki Morishita updated CASSANDRA-4237:
--------------------------------------
Attachment: (was: 4237.txt)
> Add back 0.8-style memtable_lifetime feature
> --------------------------------------------
>
> Key: CASSANDRA-4237
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4237
> Project: Cassandra
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Jonathan Ellis
> Assignee: Yuki Morishita
> Priority: Minor
> Fix For: 1.2.0
>
>
> Back in 0.8 we had a memtable_lifetime_in_minutes setting. We got rid of it in 1.0 when we added CASSANDRA-2427, which is a better way to ensure flushing on low-activity memtables.
> However, at the same time we also added the ability to disable durable writes. So it's entirely possible to configure a low-activity memtable, that isn't part of the commitlog. So, we should add back a memtable lifetime setting.
> An additional motive is pointed out by http://www.fsl.cs.sunysb.edu/~pshetty/socc11-gtssl.pdf: if you have a *high* activity columnfamily, and don't require absolute durability, the commitlog is redundant if you are flushing faster than the commitlog sync period. So, disabling durable writes but setting memtable lifetime to the same as the commitlog sync would be a reasonable optimization.
> Thus, when we add back memtable lifetime, I think we should measure it in seconds or possibly even milliseconds (to match commitlog_sync_period) rather than minutes.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-4237) Add back 0.8-style
memtable_lifetime feature
Posted by "Yuki Morishita (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yuki Morishita updated CASSANDRA-4237:
--------------------------------------
Attachment: (was: 4237.txt)
> Add back 0.8-style memtable_lifetime feature
> --------------------------------------------
>
> Key: CASSANDRA-4237
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4237
> Project: Cassandra
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Jonathan Ellis
> Assignee: Yuki Morishita
> Priority: Minor
> Fix For: 1.2.0
>
> Attachments: 4237.txt
>
>
> Back in 0.8 we had a memtable_lifetime_in_minutes setting. We got rid of it in 1.0 when we added CASSANDRA-2427, which is a better way to ensure flushing on low-activity memtables.
> However, at the same time we also added the ability to disable durable writes. So it's entirely possible to configure a low-activity memtable, that isn't part of the commitlog. So, we should add back a memtable lifetime setting.
> An additional motive is pointed out by http://www.fsl.cs.sunysb.edu/~pshetty/socc11-gtssl.pdf: if you have a *high* activity columnfamily, and don't require absolute durability, the commitlog is redundant if you are flushing faster than the commitlog sync period. So, disabling durable writes but setting memtable lifetime to the same as the commitlog sync would be a reasonable optimization.
> Thus, when we add back memtable lifetime, I think we should measure it in seconds or possibly even milliseconds (to match commitlog_sync_period) rather than minutes.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-4237) Add back 0.8-style
memtable_lifetime feature
Posted by "Yuki Morishita (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yuki Morishita updated CASSANDRA-4237:
--------------------------------------
Attachment: 4237.txt
OK, this attached version schedules flush at Memtable creation when memtable_flush_period_in_ms is set, and it tries to keep flushing at the same interval after memtable is expired.
> Add back 0.8-style memtable_lifetime feature
> --------------------------------------------
>
> Key: CASSANDRA-4237
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4237
> Project: Cassandra
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Jonathan Ellis
> Assignee: Yuki Morishita
> Priority: Minor
> Fix For: 1.2.0
>
> Attachments: 4237.txt
>
>
> Back in 0.8 we had a memtable_lifetime_in_minutes setting. We got rid of it in 1.0 when we added CASSANDRA-2427, which is a better way to ensure flushing on low-activity memtables.
> However, at the same time we also added the ability to disable durable writes. So it's entirely possible to configure a low-activity memtable, that isn't part of the commitlog. So, we should add back a memtable lifetime setting.
> An additional motive is pointed out by http://www.fsl.cs.sunysb.edu/~pshetty/socc11-gtssl.pdf: if you have a *high* activity columnfamily, and don't require absolute durability, the commitlog is redundant if you are flushing faster than the commitlog sync period. So, disabling durable writes but setting memtable lifetime to the same as the commitlog sync would be a reasonable optimization.
> Thus, when we add back memtable lifetime, I think we should measure it in seconds or possibly even milliseconds (to match commitlog_sync_period) rather than minutes.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-4237) Add back 0.8-style
memtable_lifetime feature
Posted by "Yuki Morishita (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yuki Morishita updated CASSANDRA-4237:
--------------------------------------
Attachment: 4237.txt
Patch attached to introduce new CF property *memtable_flush_period_in_ms*, which defaults to 0 (means disabled), to control periodic memtable flush in milliseconds.
> Add back 0.8-style memtable_lifetime feature
> --------------------------------------------
>
> Key: CASSANDRA-4237
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4237
> Project: Cassandra
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Jonathan Ellis
> Assignee: Yuki Morishita
> Priority: Minor
> Fix For: 1.2
>
> Attachments: 4237.txt
>
>
> Back in 0.8 we had a memtable_lifetime_in_minutes setting. We got rid of it in 1.0 when we added CASSANDRA-2427, which is a better way to ensure flushing on low-activity memtables.
> However, at the same time we also added the ability to disable durable writes. So it's entirely possible to configure a low-activity memtable, that isn't part of the commitlog. So, we should add back a memtable lifetime setting.
> An additional motive is pointed out by http://www.fsl.cs.sunysb.edu/~pshetty/socc11-gtssl.pdf: if you have a *high* activity columnfamily, and don't require absolute durability, the commitlog is redundant if you are flushing faster than the commitlog sync period. So, disabling durable writes but setting memtable lifetime to the same as the commitlog sync would be a reasonable optimization.
> Thus, when we add back memtable lifetime, I think we should measure it in seconds or possibly even milliseconds (to match commitlog_sync_period) rather than minutes.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-4237) Add back 0.8-style
memtable_lifetime feature
Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13449984#comment-13449984 ]
Jonathan Ellis commented on CASSANDRA-4237:
-------------------------------------------
Hmm, I think this means that if perform a scheduled forceFlush but it's clean, we don't schedule another flush attempt.
Maybe brute force every 10s isn't so bad? Bonus: accomodates changing the period via mbean for free (which we should allow), without having to try to retrieve a ScheduledTask and cancel it.
> Add back 0.8-style memtable_lifetime feature
> --------------------------------------------
>
> Key: CASSANDRA-4237
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4237
> Project: Cassandra
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Jonathan Ellis
> Assignee: Yuki Morishita
> Priority: Minor
> Fix For: 1.2.0
>
> Attachments: 4237.txt
>
>
> Back in 0.8 we had a memtable_lifetime_in_minutes setting. We got rid of it in 1.0 when we added CASSANDRA-2427, which is a better way to ensure flushing on low-activity memtables.
> However, at the same time we also added the ability to disable durable writes. So it's entirely possible to configure a low-activity memtable, that isn't part of the commitlog. So, we should add back a memtable lifetime setting.
> An additional motive is pointed out by http://www.fsl.cs.sunysb.edu/~pshetty/socc11-gtssl.pdf: if you have a *high* activity columnfamily, and don't require absolute durability, the commitlog is redundant if you are flushing faster than the commitlog sync period. So, disabling durable writes but setting memtable lifetime to the same as the commitlog sync would be a reasonable optimization.
> Thus, when we add back memtable lifetime, I think we should measure it in seconds or possibly even milliseconds (to match commitlog_sync_period) rather than minutes.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-4237) Add back 0.8-style
memtable_lifetime feature
Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457134#comment-13457134 ]
Jonathan Ellis commented on CASSANDRA-4237:
-------------------------------------------
bq. There is expire check when flushed memtable is clean and reschedule another flush
Hmm... is there a race here where if user manually calls force flush while it's expired, we get two scheduled tasks added?
Maybe just inlining a simple runnable instead of using forceFlush would be cleaner. (We don't need to worry about indexes being dirty independently of the base memtable in this case, either.)
bq. 10sec brute force would work if memtable_flush_period is set longer (seconds or minutes).
Good point.
bq. Here, you mean the period of brute force flush?
Yes.
> Add back 0.8-style memtable_lifetime feature
> --------------------------------------------
>
> Key: CASSANDRA-4237
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4237
> Project: Cassandra
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Jonathan Ellis
> Assignee: Yuki Morishita
> Priority: Minor
> Fix For: 1.2.0
>
> Attachments: 4237.txt
>
>
> Back in 0.8 we had a memtable_lifetime_in_minutes setting. We got rid of it in 1.0 when we added CASSANDRA-2427, which is a better way to ensure flushing on low-activity memtables.
> However, at the same time we also added the ability to disable durable writes. So it's entirely possible to configure a low-activity memtable, that isn't part of the commitlog. So, we should add back a memtable lifetime setting.
> An additional motive is pointed out by http://www.fsl.cs.sunysb.edu/~pshetty/socc11-gtssl.pdf: if you have a *high* activity columnfamily, and don't require absolute durability, the commitlog is redundant if you are flushing faster than the commitlog sync period. So, disabling durable writes but setting memtable lifetime to the same as the commitlog sync would be a reasonable optimization.
> Thus, when we add back memtable lifetime, I think we should measure it in seconds or possibly even milliseconds (to match commitlog_sync_period) rather than minutes.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-4237) Add back 0.8-style
memtable_lifetime feature
Posted by "Yuki Morishita (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452425#comment-13452425 ]
Yuki Morishita commented on CASSANDRA-4237:
-------------------------------------------
bq. Hmm, I think this means that if perform a scheduled forceFlush but it's clean, we don't schedule another flush attempt.
There is expire check when flushed memtable is clean and reschedule another flush.
bq. Maybe brute force every 10s isn't so bad?
10sec brute force would work if memtable_flush_period is set longer (seconds or minutes).
bq. Bonus: accomodates changing the period via mbean for free (which we should allow), without having to try to retrieve a ScheduledTask and cancel it
Here, you mean the period of brute force flush?
> Add back 0.8-style memtable_lifetime feature
> --------------------------------------------
>
> Key: CASSANDRA-4237
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4237
> Project: Cassandra
> Issue Type: New Feature
> Components: Core
> Affects Versions: 1.0.0
> Reporter: Jonathan Ellis
> Assignee: Yuki Morishita
> Priority: Minor
> Fix For: 1.2.0
>
> Attachments: 4237.txt
>
>
> Back in 0.8 we had a memtable_lifetime_in_minutes setting. We got rid of it in 1.0 when we added CASSANDRA-2427, which is a better way to ensure flushing on low-activity memtables.
> However, at the same time we also added the ability to disable durable writes. So it's entirely possible to configure a low-activity memtable, that isn't part of the commitlog. So, we should add back a memtable lifetime setting.
> An additional motive is pointed out by http://www.fsl.cs.sunysb.edu/~pshetty/socc11-gtssl.pdf: if you have a *high* activity columnfamily, and don't require absolute durability, the commitlog is redundant if you are flushing faster than the commitlog sync period. So, disabling durable writes but setting memtable lifetime to the same as the commitlog sync would be a reasonable optimization.
> Thus, when we add back memtable lifetime, I think we should measure it in seconds or possibly even milliseconds (to match commitlog_sync_period) rather than minutes.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira