Archived

This forum has been archived. Please start a new discussion on GitHub.

Modify slice in production

Hi,

I have a "little" problem with my slice definition. I have the following system:

* 1 Device (using Ice, cannot upgradeable Slice)
* 1 Server (using Ice)
* 1 Device (smartphone, upgradeable Slice)

My definition of slice is something like:
module MyModule {

  enum Status { StatusA, StatusB, StatusC }

  struct NodeStatus {
      string identifier;
      Status status;
  }

  interface MyInterface {
      NodeStatus getStatus(string id);
  }
}

With this in mind, I need a new status: StatusD.

How can I do the update the slice whereas Device no upgradeable can work normally with the first slice and second?

The status is sent by Device (no upgradeable), and the smartphone receive the status. Then, I wish that the Device (no upgradeable) can works fine with the slice with an extra status.

I have read: https://doc.zeroc.com/display/Ice/Facets+and+Versioning but I cannot see how can I do the changes in order to have my goal.

Thank you in advance,

Best regards,

Comments

  • matthew
    matthew NL, Canada
    Versioning is a tricky subject!

    In your case if your old device will never receive the new status enumeration value then you can add it to the slice. However, you must be careful. If the device receives this new value it will throw a marshal exception as the value is out of what the device considers to be the valid range.
  • Hi,

    I have changed the enum and it works ok. My new devices (not upgradeable) are the only that send this new state, and it (new and old devices) don't needed use this status from server.

    Thank you for your support.

    Best regards,
  • matthew
    matthew NL, Canada
    Just to be clear the problem would be if the old un-upgradable devices are sent this this new status value. For example, if your un-upgradable device called getStatus() which returned the new status enumeration the getStatus() invocatin would throw an UnmarshalException.

    What this effectively means is that either your un-upgradable device must correctly handle this exception, or your server must know the invocation was made by an old device and must not send this new status value.