[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alter table

(My advice stands, I still believe it to be safe in all modern versions not impacted by 13004, but)

There’s little difference between adding columns and removing columns - if you’re afraid of writes while you add columns, you should be afraid of writes while you remove columns.

(But I don’t think you should be afraid of either)

Jeff Jirsa

On Aug 1, 2018, at 6:43 PM, Visa <liguilin2015@xxxxxxxxx> wrote:

Thanks for all the inputs! We’ll stick to the current approach then.

How about dropping columns - If we also stop writes beforehand, we should be safe from data alignment issue after dropping columns?


On Jul 31, 2018, at 04:14, James Shaw <jxyshaw@xxxxxxxxx> wrote:

in a heavy transaction PROD env, it is risk, considering c* has a lot of bugs.
the DDL has to be replicated to all nodes,  use nodetool describecluster to check schema version same on all nodes, if not,  you may restart that node which DDL not replicated.
in new version, DDL is none or all,  you may not get it success.

It is similar to rdbms,  alter table in a heavy transaction PROD env, may get resource busy error.

in non-prod, we always apply new DDL without stop applications, never had issue.



On Tue, Jul 31, 2018 at 1:37 AM, Jeff Jirsa <jjirsa@xxxxxxxxx> wrote:
This is safe (and normal, and good) in all versions except those impacted by 

So if you're on 2.1, 2.2, or 3.11 you're fine

If you're on 3.0 between 3.0.0 and 3.0.13, you should upgrade first (to newest 3.0, probably 3.0.17)
If you're on a version between 3.1 and 3.10, you should upgrade first (to newest 3.11, probably 3.11.3)

- Jeff

On Mon, Jul 30, 2018 at 10:16 PM, Visa <liguilin2015@xxxxxxxxx> wrote:
Hi all,

I have one question about altering schema. If we only add columns, is it ok to alter the schema while the writes to the table are happening at the same time? We can control that the writes will not touch the new columns until the schema change is done. Or better to stop the writes to that table first.


To unsubscribe, e-mail:
For additional commands, e-mail: user-help@xxxxxxxxxxxxxxxxxxxx