You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/xostor/xostor.md
+76Lines changed: 76 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1204,3 +1204,79 @@ This data block is moved later, and the process caller (here tapdisk) is only no
1204
1204
This algorithm is efficient in not having to wait for writes to be flushed to the local disk as well as to other DRBDs replicated on other nodes.
1205
1205
However, if a power outage occurs on a machine using a cache that contains data, the data will be lost.
1206
1206
You don't have this issue with writethrough, but this mode is only used for read performance.
1207
+
1208
+
### How to fix a LINSTOR database corruption?
1209
+
1210
+
:::warning
1211
+
If you are in a situation where you don't know what you're doing, contact [Vates Pro Support](https://vates.tech/pricing-and-support) for guidance that applies to your specific situation. This repair may not be sufficient. It depends on what error the SMAPI indicates.
1212
+
:::
1213
+
1214
+
After a total network outage or a critical crash of an entire XOSTOR pool, in very rare situations a transaction to the LINSTOR H2 database may not proceed as expected. This can lead to LINSTOR logs similar to this one:
1215
+
```
1216
+
Caused by:
1217
+
==========
1218
+
1219
+
Category: Exception
1220
+
Class name: JdbcSQLException
1221
+
Class canonical name: org.h2.jdbc.JdbcSQLException
1222
+
Generated at: Method 'getJdbcSQLException', Source file 'DbException.java', Line #357
1223
+
1224
+
Error message: General error: "java.lang.IllegalStateException: File corrupted in chunk 128080, expected page length 4..768, got 1869573198 [1.4.197/6]"; SQL statement:
1225
+
DELETE FROM PROPS_CONTAINERS WHERE PROPS_INSTANCE = ? AND PROP_KEY = ? [50000-197]
1226
+
```
1227
+
1228
+
The interesting part for recognizing database corruption is simply this message: "File corrupted in chunk XXX...".
1229
+
1230
+
In this situation, the XCP-ng driver cannot function correctly because it relies heavily on this database.
1231
+
To repair the driver, follow these steps:
1232
+
1233
+
1. Disconnect the SR from each host in the pool via XOA. If this fails, proceed to the next step.
1234
+
1235
+
2. Stop the satellites on each host:
1236
+
```
1237
+
systemctl stop linstor-satellite
1238
+
```
1239
+
1240
+
3. Log in to the host where the controller is running. The `/var/lib/linstor` folder should be mounted. You can verify this using the `mountpoint` command:
1241
+
```
1242
+
mountpoint /var/lib/linstor
1243
+
/var/lib/linstor is a mountpoint
1244
+
```
1245
+
1246
+
Copy these files from the database folder: `linstordb.mv.db` and `linstordb.trace.db` into another folder:
1247
+
```
1248
+
mkdir linstor.bak
1249
+
cp /var/lib/linstor/*.db linstor.bak/
1250
+
```
1251
+
1252
+
4. Download the `H2` tool from [the official website](https://www.h2database.com/html/download-archive.html). The version to download corresponds to the one used by the installed version of LINSTOR. This information can be found on the LINSTOR server [git repository](https://github.com/LINBIT/linstor-server/blob/master/build.gradle).
1253
+
1254
+
5. Extract the H2 archive, replace the `<H2_FOLDER>` and `<H2_VERSION>` and run the recovery tool in the copied database folder:
The database should work fine now, but — as mentioned in the introduction — there might still be a few issues to fix (like corrupted or blocked resources).
0 commit comments