Database / Mnesia basics Interview questions
How do you troubleshoot a Mnesia table stuck in the "loading" state?
A table stuck loading after a restart usually means Mnesia can't decide it has a safe, up-to-date copy to load from — commonly after an unclean shutdown, a network partition that separated replicas, or a node coming back up while unsure whether another replica holds newer data.
mnesia:table_info(person, where_to_read). %% check which node it's trying to read from mnesia:system_info(running_db_nodes). %% confirm which nodes are actually connected
Practical steps: first confirm which other nodes are actually reachable and running
(mnesia:system_info(running_db_nodes)), since the stuck node may simply be waiting on a replica
that's down or unreachable. Check the logs for messages about inconsistent database state, which indicate
Mnesia detected conflicting views of the data and is refusing to guess which copy is authoritative. If you can
confirm which node's copy is actually the correct, most recent one, that's the point where
mnesia:force_load_table/1 becomes the (last-resort) way to break the deadlock.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
