Persistent storage data gets lost on restarting the image

Description

When using agl-service-data-persistence, the data gets lost when the image is restarted. But the Data should be present in the database as it is a persistent storage. I'm trying to figure out how to keep the database alive between restarts.

Also, database is stored in location /var/platform-scope and this might be the reason why it gets wiped on restart.

 

Steps to reproduce the issue:

  1. To launch the image, run qemu from the command line. On the lamprey branch, the image is agl-demo-platform-crosssdk for x86-64.

  2. Run afb-daemon —ws-client=unix:/run/platform/apis/ws/persistence —port=xxxx —token=' ' -v to start the api. 

  3. To test the api, use afb-client-demo localhost:xxxx/api?token=' ' persistence insert {"key":"k","value":"v"}
    persistence read {"key":"k"}

  4. Data is lost when the image is restarted.

Environment

None

Activity

Shruti 
July 11, 2022 at 9:28 AM

I didn't get consistent behavior on qemu but it worked fine for me on raspberryPi. It can be closed.

Walt Miner 
June 29, 2022 at 4:48 PM

 Still an issue?  Can this be closed?

Shruti 
May 27, 2022 at 10:38 AM

Yes, I am using unmodified lamprey tree as base. With respect to afb-daemon I guess you are right, I was doing some extra steps maybe.

Scott Murray 
May 26, 2022 at 4:46 PM

Installed widgets absolutely should persist if using an agl-demo-platform image in qemu, I've never seen what you describe.  The only way they will not is if you've modified the configuration somehow such that /var/lib is not persistent.  Can you confirm that you are running a completely unmodified lamprey tree as your base?  As for the use of afb-daemon, I have no idea why any of that would be required if you're building and installing widgets.  Just use "afm-util start" or run the systemd unit that gets generated when a widget is installed with systemctl.

Shruti 
May 26, 2022 at 4:25 PM

Yes, by restart I mean rebooting. Also, it is always required to copy and install the widget again. I'm not sure why it doesn't persists probably because it is emulation. 

Before I was running persistence directly through afb-daemon but now I am using service to service communication, so afb-daemon is being used to run helloworld service. Isn't this the correct flow or am I missing something?

Won't Fix

Details

Assignee

Reporter

Fix versions

Labels

Hardware Platform(s) Affected

QEMU x86_64

Affects versions

Due date

Priority

Created May 18, 2022 at 11:43 AM
Updated July 22, 2022 at 3:06 PM
Resolved July 22, 2022 at 3:06 PM