dcapwell commented on code in PR #3954: URL: https://github.com/apache/cassandra/pull/3954#discussion_r1985852393
########## src/java/org/apache/cassandra/service/accord/serializers/Version.java: ########## @@ -0,0 +1,133 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.service.accord.serializers; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.apache.cassandra.db.TypeSizes; +import org.apache.cassandra.io.MessageVersionProvider; +import org.apache.cassandra.io.util.DataInputPlus; +import org.apache.cassandra.io.util.DataOutputPlus; +import org.apache.cassandra.net.MessagingService; + +public enum Version implements MessageVersionProvider +{ + // If MessagingService version bumps, this mapping does not need to be updated; only updates needed are those that + // include accord serializer changes. + V1(1, MessagingService.Version.VERSION_51); + + public static final Version LATEST = Version.V1; + /** + * Version that should be used for disk serialization where downgrade may be possible. + * + * As of this writing only 1 version exists, so this is the same as LATEST... Once v2 comes into the picture we need this version to be the oldest version needed for downgrade... If you upgrade from 5.1 to 5.2 (assuming this adds a v2) you need a version that works with 5.1 here. + */ + public static final Version DOWNGRADE_SAFE_VERSION = Version.V1; + + /** + * Version that should be used for messaging serialization where mixed versions may be possible. + * + * As of this writing only 1 version exists, so this is the same as LATEST... Once v2 comes into the picture we need this version to be the oldest version needed for downgrade... If you upgrade from 5.1 to 5.2 (assuming this adds a v2) you need a version that works with 5.1 here. + */ + public static final Version CLUSTER_SAFE_VERSION = Version.V1; Review Comment: these fields are here mostly for documentation at the moment as we only have one version. One issue with `CLUSTER_SAFE_VERSION` is knowing what is safe. "should" this be part of the "capabilities" work some people want? Is this inferred based off version (how repair does this)? I left the answer to this out of scope for the moment. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org