Where is Greengrass Named Shadow Cached? (are they?)

0

My named shadow is persisting old non-existing elements from an older shadow version.

  • If I delete the shadow from the AWS console. The next revision on any changes will restore the shadow, including old fields. Shadows that have no updates do not reappear.
  • If I use the GG v2 client to delete the shadow from the IOT device, no changes. Something knows not to push a new shadow to the cloud. The two methods are update_thing_shadow and delete_thing_shadow.
  • I looked at the ShadowManager configuration and I don't see any configuration to always reflect changes if the cloud is missing the document.
  • The directionality is deviceToCloud, realTime

It seems like the ShadowManager is persisting some cache of the current named shadow and suppressing updates to the cloud? I would expect, that if the named shadows in the cloud are deleted, shadows, at a minimum would repopulate.

I would also assume if I invoked "delete_thing_shadow" on the IOT device, it would clear any cache and try to push the new document up to the cloud.

I could have a mistake in the delete_thing_shadow on the IOT device, but I'm fairly certain I'm invoking it correctly but not sure where these documents are being persisted.

TL;DR; I always want the named shadows to be pushed with ONLY the fields in "reported" with old fields removed. If I delete the named shadow in the cloud, I expect the device to repopulate the shadow.

Thanks in advance!

nwind21
asked 7 months ago242 views
1 Answer
0

When the shadow sync direction is set to deviceToCloud, if a named shadow is deleted on the cloud side, its local shadow on the device won't be cleared or removed. This is because the device is not aware of those shadow changes from the cloud, and so, it doesn't act on it. The only way to delete the local shadow in this case is by using the delete_thing_shadow API.

So, when the next update happens on the local shadow (using update_thing_shadow), shadow manager updates the current local state accordingly and then syncs it to the cloud. That means, the older state of shadow may still be present if the local update is partial.

AWS
Saranya
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions