You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Nandakishore Tokala <na...@gmail.com> on 2018/06/07 17:03:00 UTC

Schema version mismatch

what is the schema version in Cassandra and for what are all the changes
schema version is changed?

why do we see schema version mismatch other than upgrades time?
Can we solve the schema version mismatch without restart the Cassandra nodes



-- 
Thanks & Regards,
Nanda Kishore

Re: Schema version mismatch

Posted by Nandakishore Tokala <na...@gmail.com>.
FYI

this is the info I got after research on schema version

what is the schema version in Cassandra and for what are all the changes
schema version is changed?

schema version is a UUID used to set a baseline version of the schema. It
tracks if a schema migration is required. Schema version changes when there
is any schema changes made to the cluster like adding or dropping
tables/column/keyspaces i.e CREATE, DROP, ALTER etc.

why do we see schema version mismatch other than upgrades time?

It can be seen when schema changes are made i.e DDL statements are issues
concurrently.
If a node is down and schema changes are being made.
NTP is not in sync
If the nodes in the cluster are running with mixed  Apache versions.
Cassandra schema updates assume that schema changes are done one-at-a-time.
If you make multiple changes at the same time, you can cause some nodes to
end up with a different schema, than others.

Can we solve the schema version mismatch without restart the Cassandra nodes

When you only have one node in disagreement, the easiest way is simply to
run nodetool resetlocalschema, which will make that node forget it's schema
and request it again from the other nodes.

When you have more than one node in disagreement, it becomes more
difficult, because you can't control which node will respond to the schema
request, so one of the nodes with the wrong schema could send it back to
the node where you ran resetlocalschema, and then it will still be in
disagreement with the majority.

In this case, you need to shut down all the nodes that have the incorrect
schema, then start them up one node at a time and after each node comes up,
run nodetool resetlocalschema. Check that the schema is now in agreement
for all the nodes that are currently running, and then repeat the process
for each remaining node that has the incorrect schema.

On Thu, Jun 7, 2018 at 4:54 PM, Nandakishore Tokala <
nandakishore.tokala@gmail.com> wrote:

> Thanks Justin
>
> On Thu, Jun 7, 2018 at 4:27 PM, Justin Cameron <ju...@instaclustr.com>
> wrote:
>
>> You may run into schema mismatch issues if you make multiple schema
>> alterations in a very short period of time (e.g. if you're programmatically
>> modifying tables 50x a second). You'll be better off making schema changes
>> in advance. If you need to make dynamic changes then you could check the
>> version to make sure that the previous change has applied before applying
>> the next one.
>>
>> AFAIK the only way to resolve schema mismatch is a rolling restart
>>
>> On Fri, 8 Jun 2018 at 03:03 Nandakishore Tokala <
>> nandakishore.tokala@gmail.com> wrote:
>>
>>> what is the schema version in Cassandra and for what are all the changes
>>> schema version is changed?
>>>
>>> why do we see schema version mismatch other than upgrades time?
>>> Can we solve the schema version mismatch without restart the
>>> Cassandra nodes
>>>
>>>
>>>
>>>
>>> --
>>> Thanks & Regards,
>>> Nanda Kishore
>>>
>> --
>>
>>
>> *Justin Cameron*Senior Software Engineer
>>
>>
>> <https://www.instaclustr.com/>
>>
>>
>> This email has been sent on behalf of Instaclustr Pty. Limited
>> (Australia) and Instaclustr Inc (USA).
>>
>> This email and any attachments may contain confidential and legally
>> privileged information.  If you are not the intended recipient, do not copy
>> or disclose its content, but please reply to this email immediately and
>> highlight the error to the sender and then immediately delete the message.
>>
>
>
>
> --
> Thanks & Regards,
> Nanda Kishore
>



-- 
Thanks & Regards,
Nanda Kishore

Re: Schema version mismatch

Posted by Nandakishore Tokala <na...@gmail.com>.
Thanks Justin

On Thu, Jun 7, 2018 at 4:27 PM, Justin Cameron <ju...@instaclustr.com>
wrote:

> You may run into schema mismatch issues if you make multiple schema
> alterations in a very short period of time (e.g. if you're programmatically
> modifying tables 50x a second). You'll be better off making schema changes
> in advance. If you need to make dynamic changes then you could check the
> version to make sure that the previous change has applied before applying
> the next one.
>
> AFAIK the only way to resolve schema mismatch is a rolling restart
>
> On Fri, 8 Jun 2018 at 03:03 Nandakishore Tokala <
> nandakishore.tokala@gmail.com> wrote:
>
>> what is the schema version in Cassandra and for what are all the changes
>> schema version is changed?
>>
>> why do we see schema version mismatch other than upgrades time?
>> Can we solve the schema version mismatch without restart the
>> Cassandra nodes
>>
>>
>>
>>
>> --
>> Thanks & Regards,
>> Nanda Kishore
>>
> --
>
>
> *Justin Cameron*Senior Software Engineer
>
>
> <https://www.instaclustr.com/>
>
>
> This email has been sent on behalf of Instaclustr Pty. Limited (Australia)
> and Instaclustr Inc (USA).
>
> This email and any attachments may contain confidential and legally
> privileged information.  If you are not the intended recipient, do not copy
> or disclose its content, but please reply to this email immediately and
> highlight the error to the sender and then immediately delete the message.
>



-- 
Thanks & Regards,
Nanda Kishore

Re: Schema version mismatch

Posted by Justin Cameron <ju...@instaclustr.com>.
You may run into schema mismatch issues if you make multiple schema
alterations in a very short period of time (e.g. if you're programmatically
modifying tables 50x a second). You'll be better off making schema changes
in advance. If you need to make dynamic changes then you could check the
version to make sure that the previous change has applied before applying
the next one.

AFAIK the only way to resolve schema mismatch is a rolling restart

On Fri, 8 Jun 2018 at 03:03 Nandakishore Tokala <
nandakishore.tokala@gmail.com> wrote:

> what is the schema version in Cassandra and for what are all the changes
> schema version is changed?
>
> why do we see schema version mismatch other than upgrades time?
> Can we solve the schema version mismatch without restart the
> Cassandra nodes
>
>
>
>
> --
> Thanks & Regards,
> Nanda Kishore
>
-- 


*Justin Cameron*Senior Software Engineer


<https://www.instaclustr.com/>


This email has been sent on behalf of Instaclustr Pty. Limited (Australia)
and Instaclustr Inc (USA).

This email and any attachments may contain confidential and legally
privileged information.  If you are not the intended recipient, do not copy
or disclose its content, but please reply to this email immediately and
highlight the error to the sender and then immediately delete the message.