Suppose I have 5 service instances that all form an Ignite cluster (v2.1).
The POJO I have for a cache looks like:

public static class MyCachePojo {
    @QuerySqlField(name="fieldA")
    private java.lang.String fieldA;
    @QuerySqlField(name="fieldB")
    private java.lang.String fieldB;
    @QuerySqlField(name="fieldC")
    private java.lang.String fieldC;
}

And I am try to do a rolling update (zero downtime deploy) that adds a
field to this, and I want the field to be available from SQL.

public static class MyCachePojo {
    @QuerySqlField(name="fieldA")
    private java.lang.String fieldA;
    @QuerySqlField(name="fieldB")
    private java.lang.String fieldB;
    @QuerySqlField(name="fieldC")
    private java.lang.String fieldC;
    @QuerySqlField(name="fieldD")
    private java.lang.String fieldD;
}


When an instance starts up and joins the ignite cluster, it creates a
CacheConfiguration object. It then calls setIndexedTypes on the
CacheConfiguration object and uses it to getOrCreate the MyCachePojo cache.
The part I found surprising was that the new SQL configuration is ignored
when calling getOrCreate in the case where the cache already exists (such
as in a rolling upgrade).
Subsequent SQL queries involving fieldD will always fail with Column Not
Found. Standard put/get operations can serialize and deserialize the new
field just fine.
So my question is, is there a way I can get Ignite to always pick up new
columns on rolling restart without handcrafting DDL statements or using
clever reflection?


Thanks!
Cody

Reply via email to