Store it on the repack context so that we can log a more informative
message "Repacking from format x to format y".
While this is not really a big deal currently, it could be worth
recording for potential future scenarios (i.e. supporting three or more
pack versions), where upgrades could potentially skip an intermediary
pack format version.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
ldb_kv->target_pack_format_version) {
int r;
struct ldb_context *ldb = ldb_module_get_ctx(ldb_kv->module);
- ldb_kv->pack_format_version =
- ldb_kv->target_pack_format_version;
r = ldb_kv_repack(ldb_kv->module);
if (r != LDB_SUCCESS) {
ldb_debug(ldb, LDB_DEBUG_ERROR,
int error;
uint32_t count;
bool normal_record_seen;
+ uint32_t old_version;
};
struct ldb_kv_repack_context ctx;
int ret;
+ ctx.old_version = ldb_kv->pack_format_version;
ctx.count = 0;
ctx.error = LDB_SUCCESS;
ctx.normal_record_seen = false;
+ ldb_kv->pack_format_version = ldb_kv->target_pack_format_version;
+
/* Iterate all database records and repack them in the new format */
ret = ldb_kv->kv_ops->iterate(ldb_kv, re_pack, &ctx);
if (ret < 0) {