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

Add cassandra v4 support #3225

Merged
merged 8 commits into from
Aug 29, 2021
Merged

Conversation

Ashmita152
Copy link
Contributor

@Ashmita152 Ashmita152 commented Aug 23, 2021

Which problem is this PR solving?

Resolves #3080

Short description of the changes

We don't need to add v003tov004.sh because the change (removal of dclocal_read_repair_chance config) is in table metadata which gets handled seemlessly within cassandra upgrade (tested locally) when users upgrade their cassandra cluster from v3.11 to v4.0. So there won't be any scenario, where existing user will need migrate their data.

@Ashmita152 Ashmita152 requested a review from a team as a code owner August 23, 2021 13:28
@codecov
Copy link

codecov bot commented Aug 23, 2021

Codecov Report

Merging #3225 (c13212a) into master (7b0958d) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3225      +/-   ##
==========================================
- Coverage   95.99%   95.99%   -0.01%     
==========================================
  Files         242      242              
  Lines       14789    14813      +24     
==========================================
+ Hits        14197    14220      +23     
- Misses        513      514       +1     
  Partials       79       79              
Impacted Files Coverage Δ
cmd/query/app/grpc_handler.go 98.68% <100.00%> (+0.15%) ⬆️
cmd/query/app/server.go 94.11% <0.00%> (-1.48%) ⬇️
cmd/query/app/static_handler.go 97.00% <0.00%> (-0.60%) ⬇️
plugin/storage/badger/spanstore/reader.go 96.21% <0.00%> (+0.70%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0055bd8...c13212a. Read the comment docs.

We don't need to add v003tov004.sh because the change (removal of dclocal_read_repair_chance config) is in table metadata which gets handled seemlessly within cassandra upgrade when users upgrade their cassandra cluster from v3.11 to v4.0. Refactor cassandra integration tests to run on both cassandra v3.11 and v4.0.

Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com>
…h one

Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com>
Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com>
Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com>
fi
}

setup_cassandra() {
Copy link
Member

Choose a reason for hiding this comment

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

this is a nice refactoring, makes the script much more maintainable

Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com>
yurishkuro
yurishkuro previously approved these changes Aug 27, 2021
@yurishkuro
Copy link
Member

Do we need any documentation changes? Also, we build a certain Docker image for schema initialization, how should it be changed vis-a-vis v4?

@Ashmita152
Copy link
Contributor Author

Do we need any documentation changes?

Good point. I will check update the documentation.

we build a certain Docker image for schema initialization, how should it be changed vis-a-vis v4?

Good point. Let me check this part too. As far as I know, cqlsh from v3.11 is compatible with cassandra v4, that's how it is working in integration tests right now but we can also publish two separate images for schema-initialization for v3.11 and v4.

@yurishkuro
Copy link
Member

but we can also publish two separate images for schema-initialization for v3.11 and v4.

I would rather make it an option to the single image, or even better if it could auto-detect v4 automatically.

Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com>
Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com>
@@ -1,4 +1,4 @@
FROM cassandra:3.11
FROM cassandra:4.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is done because cassandra v4.0 image contains cqlsh 6.0.0 which is backward compatible with cassandra v3.x (https://pypi.org/project/cqlsh/)

| awk -F "|" '{print $2}' \
| awk -F " " '{print $2}' \
| awk -F "." '{print $1}' \
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tested with cassandra v3.11 and v4.0 containers:

root@fa16f4b2b767:/# cqlsh -e "show version"
[cqlsh 6.0.0 | Cassandra 4.0.0 | CQL spec 3.4.5 | Native protocol v5]
root@fa16f4b2b767:/# cas_version=$(cqlsh -e "show version" \
    | awk -F "|" '{print $2}' \
    | awk -F " " '{print $2}' \
    | awk -F "." '{print $1}' \
)
root@fa16f4b2b767:/# echo $cas_version
4
root@c120e02677e6:/# cqlsh -e "show version"
[cqlsh 5.0.1 | Cassandra 3.11.11 | CQL spec 3.4.4 | Native protocol v4]
root@c120e02677e6:/# cas_version=$(cqlsh -e "show version" \
>     | awk -F "|" '{print $2}' \
>     | awk -F " " '{print $2}' \
>     | awk -F "." '{print $1}' \
> )
root@c120e02677e6:/# echo $cas_version
3

@yurishkuro yurishkuro merged commit fb4be5d into jaegertracing:master Aug 29, 2021
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.

Schema support for cassandra 4
2 participants