The live generation is provably current: read-only, it passes the shallow * integrity and format checks the staged route applies to its copy, and the * exact semantic-manifest test the staged route would answer no-op with. A * copy of it would route to that no-op and publish the same database again, * so the run ends here with nothing copied, sealed or renamed. Any doubt * answers false and t
| 2775 | * so the run ends here with nothing copied, sealed or renamed. Any doubt |
| 2776 | * answers false and the run copies and routes exactly as before. */ |
| 2777 | static bool live_generation_current(cbm_pipeline_t *p, const cbm_file_hash_t *baseline_manifest, |
| 2778 | int baseline_count) { |
| 2779 | struct stat db_st; |
| 2780 | if (!p->live_db_path || stat(p->live_db_path, &db_st) != 0) { |
| 2781 | return false; |
| 2782 | } |
| 2783 | cbm_store_t *store = cbm_store_open_path_query(p->live_db_path); |
| 2784 | if (!store) { |
| 2785 | return false; |
| 2786 | } |
| 2787 | int fmt = 0; |
| 2788 | bool current = cbm_store_check_integrity(store); |
| 2789 | if (current) { |
| 2790 | cbm_store_get_format_version(store, &fmt); |
| 2791 | current = |
| 2792 | fmt == CBM_INDEX_FORMAT_VERSION && |
| 2793 | cbm_pipeline_incremental_generation_exact(p, store, baseline_manifest, baseline_count); |
| 2794 | } |
| 2795 | cbm_store_close(store); |
| 2796 | return current; |
| 2797 | } |
| 2798 | |
| 2799 | /* Route an existing generation. Full rebuilds never delete the live DB here: |
| 2800 | * publication owns the eventual atomic replacement after every pass and |
no test coverage detected