-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
CASSANDRA-18714 CQLSSTableWriter writes SAI index #3029
CASSANDRA-18714 CQLSSTableWriter writes SAI index #3029
Conversation
a183c86
to
18658f7
Compare
9d56c44
to
0575e71
Compare
src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java
Outdated
Show resolved
Hide resolved
public List<String> importNewSSTables(String ksName, String cfName, Set<String> srcPaths, boolean resetLevel, boolean clearRepaired, boolean verifySSTables, boolean verifyTokens, boolean invalidateCaches, boolean extendedVerify, boolean copyData) | ||
{ | ||
return getCfsProxy(ksName, cfName).importNewSSTables(srcPaths, resetLevel, clearRepaired, verifySSTables, verifyTokens, invalidateCaches, extendedVerify, copyData); | ||
public List<String> importNewSSTables(String ksName, String cfName, Set<String> srcPaths, boolean resetLevel, |
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 created new method instead of modifying the old one to be backward compatible / not break stuff for people using the older version already.
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.
So your comment says you added a new one, but it looks like you modified the old one... I don't know if there's anything other than the Import
command that actually uses it, but wanted to check if it was intentional that this comment doesn't match the code - or did you mean you made a new one in ColumnFamilyStore/ColumnFamilyStoreMBean
which would also make sense, and which you did... so maybe I just misunderstood this PR comment?
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.
@JeetKunDoug correct, I created new one on ColumnFamilyStore/MBean but I changed the one on NodeProbe. That is just fine, because NodeProbe one is "internal" to Cassandra. Nobody depends on NodeProbe across versions ... Does that make sense?
@@ -80,6 +80,16 @@ public class Import extends NodeToolCmd | |||
description = "Copy data from source directories instead of moving them") | |||
private boolean copyData = false; | |||
|
|||
@Option(title = "fail_on_missing_index", | |||
name = {"-f", "--fail-on-missing-index"}, |
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 am open to different flags here, -f
and -i
just makes sense to me.
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.
What do you think about -ri
/--require-index-component
and -siv
/--skip-index-validation
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.
+1 to -siv
/--skip-index-validation
Still thinking about the other...
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'm fine w/ --require-index-component
too, although I think it should be --require-index-components
. (An SAI index is really a bag of separate components that enable related functionality, but perhaps I'm too in the weeds...)
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.
for --skip-index-validation
, I do not like this one because if you notice what other flags are, there is prefix --no
- --no-verify
, --no-tokens
, --no-invalidate-caches
- there is no --skip...
. We might do --no-index-validation
, that would work, but not --skip-index-validation
.
When it comes to --require-index-component
, I do not like the fact that this does not say what happens when they are required and they are not present. To prepend it with --fail
is pretty obvious to me. Anyway, one can conclude that if something is required and it is not there, it will probably complain and fail eventually ... yeah, I think this could fly (and the fact it will fail is also mentioned in the description field).
flags are now -ri
and -niv
as in --require-index-components
and --no-index-validation
.
b0e0fa1
to
1ffc702
Compare
src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java
Outdated
Show resolved
Hide resolved
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.
Thanks so much for picking up this JIRA ticket, and already addressing the review comments I had posted earlier. Generally looks great, but I think there's one area where there's a bug introduced (in ColumnFamilyStore#importNewSSTables, where we lost the value of the copyData
parameter in one of the overloads).
@@ -80,6 +80,16 @@ public class Import extends NodeToolCmd | |||
description = "Copy data from source directories instead of moving them") | |||
private boolean copyData = false; | |||
|
|||
@Option(title = "fail_on_missing_index", | |||
name = {"-f", "--fail-on-missing-index"}, |
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.
What do you think about -ri
/--require-index-component
and -siv
/--skip-index-validation
public List<String> importNewSSTables(String ksName, String cfName, Set<String> srcPaths, boolean resetLevel, boolean clearRepaired, boolean verifySSTables, boolean verifyTokens, boolean invalidateCaches, boolean extendedVerify, boolean copyData) | ||
{ | ||
return getCfsProxy(ksName, cfName).importNewSSTables(srcPaths, resetLevel, clearRepaired, verifySSTables, verifyTokens, invalidateCaches, extendedVerify, copyData); | ||
public List<String> importNewSSTables(String ksName, String cfName, Set<String> srcPaths, boolean resetLevel, |
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.
So your comment says you added a new one, but it looks like you modified the old one... I don't know if there's anything other than the Import
command that actually uses it, but wanted to check if it was intentional that this comment doesn't match the code - or did you mean you made a new one in ColumnFamilyStore/ColumnFamilyStoreMBean
which would also make sense, and which you did... so maybe I just misunderstood this PR comment?
test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/io/sstable/AbstractSSTableSimpleWriter.java
Outdated
Show resolved
Hide resolved
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.
Overall structure looks pretty good. A few things to resolve around per-column component validation, some naming to finalize, and maybe a new test case for empty index validation, and we should be set...
60f7692
to
bed6fc5
Compare
src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/StorageAttachedIndexGroup.java
Outdated
Show resolved
Hide resolved
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.
Left a couple minor notes, but it looks like the important stuff is all taken care of.
LGTM
Thanks for the patch!
e397f88
to
b9ab129
Compare
src/java/org/apache/cassandra/db/memtable/AbstractAllocatorMemtable.java
Outdated
Show resolved
Hide resolved
b9ab129
to
f875d7e
Compare
src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java
Outdated
Show resolved
Hide resolved
f875d7e
to
e1a3fa6
Compare
Pushed up an alternate approach to fixing the client mode issues here: fecac72 Tried to minimize the changes to existing code and the need for making up mock values by bypassing certain paths earlier. Also took some inspiration from what @smiklosovic Let me know what you think... |
This PR is replaced by #3046, yes? |
@maedhroz yes, in 3046 there are refactored tests, your commit and one extra commit fixing the issue we talked about |
874636c
to
90bdd75
Compare
patch by Stefan Miklosovic; reviewed by Caleb Rackliffe, Doug Rohrer for CASSANDRA-18714
90bdd75
to
016dd6c
Compare
Thanks for sending a pull request! Here are some tips if you're new here:
Commit messages should follow the following format:
The Cassandra Jira