mnesia


Mesia activity/4 is reading only from the first fragment


I have a mnesia cluster running on four nodes. A table name student exists with 7 fragments. According to the mnesia doc, when reading, mnesia determines from which of the fragments the record belongs, from the hash value of the key; the read is to be done through the mnesia:activity/4 function. To test the partitioning, I inserted 512 records with keys from 1-512. I look at the size attributes of the fragmented table from mnesia:table_info/2 in mnesia:activity/4 context; this confirms that the fragments has 512 records.
The problem is, when I read a record with a key ranging from(1-512) which does exists in the table, I only retrieved a record if that key is in the range of keys existing in the first fragment. In other words, mnesia is reading only from the first fragment. Don't know what i have done wrong. Please I need your help. Thanks
I found the problem. I was using mnesia dirty read operations as the functional object parameter to the mnesia:activity/4 function. I observerd that this function shouldn't be a dirty operation since the context can be determine by the AccessContext parameter. Eg.
This reads from only the first fragment:
KeysFun = fun () -> mnesia:dirty_all_keys(Tab) end,
mnesia:activity(sync_dirty, KeysFun,[],mod_frag).
This reads from all fragments:
KeysFun = fun () -> mnesia:all_keys(Tab) end,
mnesia:activity(sync_dirty, KeysFun,[],mod_frag).

Related Links

Mesia activity/4 is reading only from the first fragment
Is there a built-in mechanism for us to launch Mnesia in Elixir?
how to use mnesia:select/4 and mnesia:select/1 for paging query
Querying mnesia Fragmentated Tables using QLC returns wrong results

Categories

HOME
amazon-web-services
matrix
functional-programming
mongoid
tabs
qooxdoo
swift2
video-streaming
phpseclib
tup
sap-fiori
phpstorm-2017.1
chromecast
multi-step
stimulsoft
webstore
corona
fosuserbundle
deepfreeze
coreldraw
vuforia
pubxml
ruby-daemons
react-bootstrap-table
npoi
cube
javax.persistence
mdns
tilemill
netbios
directfb
restful-architecture
grails-2.5
busboy
netstat
stackpanel
sspi
swfupload
suds
vb.net-to-c#
morphline
absolute
brightscript
knockout-2.0
cordova-ios
sharpdx
datediff
subforms
deedle
http-basic-authentication
cognos-tm1
finder
yargs
nclam
visual-studio-monaco
coovachilli
meld
powerpoint-2013
persistent-object-store
i2b2
management-studio-express
ajax4jsf
opencyc
compositetype
google-gdk
alwayson
explain
kefir.js
subview
incron
hp-idol-ondemand
iplimage
angular-ui-select
forio-contour
rails-api
nodeload
lync-2010
compiler-flags
eclim
rautomation
sql-view
coalesce
libxml-js
acceptance-testing
reentrancy
daap
xcode4.5
zend-pdf
kolite
fbml
css-friendly
aptitude
ccl
resharper-5.0
zend-test
main-method
inversion
icon-language
stretchblt
regioninfo

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App