Code review comment: Agreed but please allow me to leave this as the last task of this review round, after emptying `restore` of rocksdb backend and remove those many `if` to prevent double-restore.

Code under review:
private void restoreKVStateMetaData() throws IOException, StateMigrationException, RocksDBException {

		
		
		
		
		KeyedBackendSerializationProxy<K> serializationProxy =
			new KeyedBackendSerializationProxy<>(userCodeClassLoader);

		serializationProxy.read(currentStateHandleInView);

		if (!isKeySerializerCompatibilityChecked) {
			
			
			TypeSerializerSchemaCompatibility<K> keySerializerSchemaCompat =
				keySerializerProvider.setPreviousSerializerSnapshotForRestoredState(serializationProxy.getKeySerializerSnapshot());
			if (keySerializerSchemaCompat.isCompatibleAfterMigration() || keySerializerSchemaCompat.isIncompatible()) {
				throw new StateMigrationException("The new key serializer must be compatible.");
			}

			isKeySerializerCompatibilityChecked = true;
		}

		this.keygroupStreamCompressionDecorator = serializationProxy.isUsingKeyGroupCompression() ?
			SnappyStreamCompressionDecorator.INSTANCE : UncompressedStreamCompressionDecorator.INSTANCE;

		List<StateMetaInfoSnapshot> restoredMetaInfos =
			serializationProxy.getStateMetaInfoSnapshots();
		currentStateHandleKVStateColumnFamilies = new ArrayList<>(restoredMetaInfos.size());

		for (StateMetaInfoSnapshot restoredMetaInfo : restoredMetaInfos) {

			StateColumnFamilyHandle registeredStateCFHandle =
				kvStateInformation.get(restoredMetaInfo.getName());

			if (registeredStateCFHandle == null) {
				byte[] nameBytes = restoredMetaInfo.getName().getBytes(ConfigConstants.DEFAULT_CHARSET);

				ColumnFamilyDescriptor columnFamilyDescriptor = new ColumnFamilyDescriptor(
					nameBytes,
					columnOptions);

				ColumnFamilyHandle columnFamily = db.createColumnFamily(columnFamilyDescriptor);

				
				
				RegisteredStateMetaInfoBase stateMetaInfo =
					RegisteredStateMetaInfoBase.fromMetaInfoSnapshot(restoredMetaInfo);
				registeredStateCFHandle = new StateColumnFamilyHandle(columnFamily, stateMetaInfo);
				RocksDBKeyedStateBackend.registerKvStateInformation(kvStateInformation, nativeMetricMonitor,
					restoredMetaInfo.getName(), registeredStateCFHandle);

			} else {
				
			}
			currentStateHandleKVStateColumnFamilies.add(registeredStateCFHandle.getColumnFamilyHandle());
		}
	}

Line commented on: keySerializerProvider.setPreviousSerializerSnapshotForRestoredState(serializationProxy.getKeySerializerSnapshot());

Revised code:
private void restoreKVStateMetaData() throws IOException, StateMigrationException, RocksDBException {
		KeyedBackendSerializationProxy<K> serializationProxy = readMetaData(currentStateHandleInView);

		this.keygroupStreamCompressionDecorator = serializationProxy.isUsingKeyGroupCompression() ?
			SnappyStreamCompressionDecorator.INSTANCE : UncompressedStreamCompressionDecorator.INSTANCE;

		List<StateMetaInfoSnapshot> restoredMetaInfos =
			serializationProxy.getStateMetaInfoSnapshots();
		currentStateHandleKVStateColumnFamilies = new ArrayList<>(restoredMetaInfos.size());

		for (StateMetaInfoSnapshot restoredMetaInfo : restoredMetaInfos) {
			RocksDbKvStateInfo registeredStateCFHandle =
				getOrRegisterStateColumnFamilyHandle(null, restoredMetaInfo);
			currentStateHandleKVStateColumnFamilies.add(registeredStateCFHandle.columnFamilyHandle);
		}
	}