[Neo-users] Storage schema upgrade for revision >= 2306

Grégory Wisniewski gregory at nexedi.com
Wed Sep 29 18:03:25 CEST 2010


Hello,

FYI, if you plan an upgrade of a NEO cluster to a revision greater than
r2306, you should follow the following steps:

- Stop the whole cluster
- Execute those SQL statements on each NEO database:

  SELECT @np := CAST(value as UNSIGNED INTEGER) FROM config
    WHERE name = 'partitions';
  ALTER TABLE trans
    ADD COLUMN partition SMALLINT UNSIGNED NOT NULL,
    DROP PRIMARY KEY,
    ADD PRIMARY KEY (partition, tid);
  UPDATE trans SET partition = MOD(tid, @np);
  ALTER TABLE obj
    ADD COLUMN partition SMALLINT UNSIGNED NOT NULL,
    DROP PRIMARY KEY,
    ADD PRIMARY KEY (partition, serial, oid);
  UPDATE obj SET partition = MOD(oid, @np);
  ALTER TABLE tobj ADD COLUMN partition SMALLINT UNSIGNED NOT NULL;
  ALTER TABLE ttrans ADD COLUMN partition SMALLINT UNSIGNED NOT NULL;

- Update code for all nodes (master, storage, client, admin).
- Restart the cluster.

Have fun.

Grégory.




More information about the Neo-users mailing list