'Gitlab : Could not read block 963 in file "base/X/Z": Cannot allocate memory

I am getting the below error in our self managed gitlab instance:

==> /var/log/gitlab/postgresql/current <==

ERROR: could not read block 0 in file "base/X/Y": read only 4096 of 8192 bytes

ERROR: could not read block 963 in file "base/X/Z": Cannot allocate memory

After searching several solutions, we found that the postgresql table X which is merge_request_diff_files in our case is corrupted.

To fix it, we truncated that table. However, the newly created data also seems to be corrupted.

Please let me know if he corrupted table needs be created again or what is the issue here?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source