[
https://issues.apache.org/jira/browse/CASSANDRA-16986?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17419418#comment-17419418
]
Josh McKenzie commented on CASSANDRA-16986:
-------------------------------------------
While in general I think your reasoning is sound, I'm curious as to what's
prompting this change right now? Seems like the current implementation is
simply a case of us being overly cautious on commit log handling in the {{DROP
TABLE}} case relative to our current constraints which, all things being equal,
isn't a _bad_ thing.
The two implicits that necessitated the logic as it stands (won't re-use commit
logs, commit logs have UIDs) are both just that, implicits as per our current
implementation. Unless there's some side-effect created by the current logic or
some change that it's impeding, I'd advocate we leave it be, or if we change
it, explicitly document these two assumptions in the related portions of the
codebase to make it clear that if we go back on that we're going to Have A Bad
Time.
As a further observation, some of this code was added in CASSANDRA-7437 which
predates the compressed CommitLog change but post-dates the changes in
CASSANDRA-5202. In general, the cautious curmudgeon in me says "If it ain't
broke, don't fix it" - but I'm definitely receptive to know the driving
motivation behind this change that is, by character count, significantly
shorter than my Jira comment here. :P
> DROP Table should not recycle active CommitLog segments
> -------------------------------------------------------
>
> Key: CASSANDRA-16986
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16986
> Project: Cassandra
> Issue Type: Improvement
> Components: Local/Commit Log
> Reporter: Aleksandr Sorokoumov
> Assignee: Aleksandr Sorokoumov
> Priority: Normal
> Fix For: 4.x
>
>
> Right now, DROP TABLE recycles all active CL segments and explicitly marks
> intervals as clean for all dropping tables. I believe that this is not
> necessary.
> Recycling of CL segments was introduced in CASSANDRA-3578. Back then, it was
> necessary to recycle all active segments because:
> 1. CommitLog reused old segments after they were clean. This is no longer the
> case, I believe, since CASSANDRA-6809.
> 2. CommitLog segments must have been closed and recycled on {{DROP TABLE}} to
> avoid resurrecting data if a table with the same name is created. This was an
> issue because tables didn't have unique ids yet (CASSANDRA-5202).
> Given that {{DROP TABLE}} triggers flush, which in turn cleans CL intervals
> in Keyspace#unloadCF, I think that we can avoid the call to
> {{forceRecycleAll}} there.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]