Fix inconsistency between cache and database 81/302481/5
authorIlho Kim <ilho159.kim@samsung.com>
Thu, 7 Dec 2023 12:40:49 +0000 (21:40 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Fri, 8 Dec 2023 00:55:18 +0000 (09:55 +0900)
commit54073ac20bd49b3d664527b7f13b04290152e268
tree9b50e0abdb835a92c9a66c333697cfcf283d07ea
parent14c243cb1f44f347aa663da5fe11310aec2e1f23
Fix inconsistency between cache and database

If there is an installation process that was started
before the cache creation task was completed on the server
then that process can attempt to write directly to the database even
after the cache generation is complete and a ready flag has been created
Using inotify, watch for changes to the database
and if there is an attempt to directly write to the database
after caching has been completed, remove all cached data

Change-Id: Ibf12fe472904467a8d5a5335f8525109aa03f32f
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/db_change_observer.cc [new file with mode: 0644]
src/common/db_change_observer.hh [new file with mode: 0644]
src/common/request_type.cc
src/common/request_type.hh
src/server/runner.cc
src/server/runner.hh
src/server/worker_thread.cc
src/server/worker_thread.hh