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 postgres 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 the corrupted table needs be created again or what is the issue here?
from the Cannot allocate memory error I would say Postgresql cannot allocate memory, I would suggest to check free memory on the server or look into Postresql troubleshooting and configuration.