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
android-espresso
macos-sierra
jms
bokeh
writefile
operating-system
compilation
filesize
odata
celery
implicit-conversion
bellman-ford
solution
graphdb
csrf
chromecast
outlook-restapi
substring
animated-gif
mod-wsgi
dragula
sap-lumira
python-imageio
django-import-export
bitbake
guice
phpstorm-2016.1
riotjs
appcode
om-next
spring-rabbitmq
bluemixtools
django-crispy-forms
llvm-ir
plane
grails3.2.0
distributed-caching
latexml
moinmoin
linq-to-excel
dredd
cyanogenmod
rm
libreoffice-writer
sonicmq
karabiner
renderman
solr-query-syntax
nivo-slider
.when
oid
visual-studio-monaco
dojo-build
fdt
gulp-uglify
currency-exchange-rates
diawi
odesk
godeps
juniper-network-connect
cfwheels
enaml
apple
blockquote
wlanapi
libz
dbmigrate
webproject
fuseesb
subfolder
scala-swing
rfc5545
dnsjava
libgcc
sql-function
preorder
jchartfx
property-injection
ctp
pbkdf2
libxml-js
xalan
android-dialog
coordinate
pageheap
pcspim
acpi
representation
winsxs
django-pagination
ninject-interception
android-input-method
asdoc
aspbutton
.net-services
rawcontacts
prism-2
bindable-linq

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App