{aborted,{no_exists,{testtab,cstruct}}}

58 views
Skip to first unread message

Bruce

unread,
Jul 15, 2008, 8:57:53 PM7/15/08
to mnesiaex-discuss
Hi

I'm having trouble creating tables with tcerl. Paul suggested that I
enable dgb:tracer() and the output is below.

The odd part seems to be a call to tcbdbtab:delete_table(testtab). Why
would it delete the table it just created?

Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] [async-threads:
0] [hipe] [kernel-poll:false]

Eshell V5.5.5 (abort with ^G)
1> c("/usr/local/work/projects/first_mnesia/src/test0", [{outdir, "/
usr/local/work/projects/first_mnesia/src/"}]).
{ok,test0}
2> dbg:tracer (), dbg:p (all, [ call ]), dbg:tpl (tcbdbtab, dbg:fun2ms
(fun
(_) -> return_trace () end)).
dbg:tracer (), dbg:p (all, [ call ]), dbg:tpl (tcbdbtab, dbg:fun2ms
(fun
2> (_) -> return_trace () end)).
{ok,[{matched,nonode@nohost,27},{saved,1}]}
3> test0:init().
{atomic,ok}
4> test0:tcerl_test().
(<0.66.0>) call tcbdbtab:create_table(testtab,{cstruct,testtab,
{external,ordered_set,tcbdbtab},
[],
[],
[],
[nonode@nohost],
0,
read_write,
[],
[],
false,
testtab,
[key,val],
[{bucket_array_size,10000},{deflate,true}],
[],
{{1216,169314,476077},nonode@nohost},
{{2,0},[]}})
(<0.66.0>) call tcbdbtab:create_table(testtab,{cstruct,testtab,
{external,ordered_set,tcbdbtab},
[],
[],
[],
[nonode@nohost],
0,
read_write,
[],
[],
false,
testtab,
[key,val],
[{bucket_array_size,10000},{deflate,true}],
[],
{{1216,169314,476077},nonode@nohost},
{{2,0},[]}},"testtab.tcb")
(<0.96.0>) call tcbdbtab:delete_table(testtab)
{aborted,{no_exists,{testtab,cstruct}}}(<0.96.0>) call
tcbdbtab:get_port(testtab)

paul mineiro

unread,
Jul 16, 2008, 12:10:18 AM7/16/08
to mnesiaex-discuss
What's really weird about this trace is that non of the functions are
returning a value (just calls, no returns). I think this means they
are throwing an exception. Also I can't tell exactly but it looks
like you started two tracers (?)

Some other things to try:

* start the emulator with -boot start_sasl
* set the mnesia debug level by starting the emulator with -mnesia
debug verbose

-- p

Bruce

unread,
Jul 16, 2008, 12:40:12 AM7/16/08
to mnesiaex-discuss
OK, here's the whole session setup as advised.

[bwhite@localhost src]$ erl -boot start_sasl -mnesia debug verbose
Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] [async-threads:
0] [hipe] [kernel-poll:false]


=PROGRESS REPORT==== 16-Jul-2008::13:26:59 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.33.0>},
{name,alarm_handler},
{mfa,{alarm_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:26:59 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.34.0>},
{name,overload},
{mfa,{overload,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:26:59 ===
supervisor: {local,sasl_sup}
started: [{pid,<0.32.0>},
{name,sasl_safe_sup},
{mfa,
{supervisor,
start_link,
[{local,sasl_safe_sup},sasl,safe]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]

=PROGRESS REPORT==== 16-Jul-2008::13:26:59 ===
supervisor: {local,sasl_sup}
started: [{pid,<0.35.0>},
{name,release_handler},
{mfa,{release_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:26:59 ===
application: sasl
started_at: nonode@nohost
Eshell V5.5.5 (abort with ^G)
1>
1> dbg:tracer (), dbg:p (all, [ call ]), dbg:tpl (tcbdbtab, dbg:fun2ms
(fun
1> (_) -> return_trace () end)).
{ok,[{matched,nonode@nohost,27},{saved,1}]}
2> tcerl:start ().

=PROGRESS REPORT==== 16-Jul-2008::13:28:10 ===
supervisor: {local,tcerlsup}
started: [{pid,<0.51.0>},
{name,tcbdbsrv},
{mfa,{tcbdbsrv,start_link,[]}},
{restart_type,permanent},
{shutdown,5000},
{child_type,worker}]
ok
=PROGRESS REPORT==== 16-Jul-2008::13:28:10 ===
application: tcerl
started_at: nonode@nohost

3> mnesia:start ().

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_sup}
started: [{pid,<0.58.0>},
{name,mnesia_event},
{mfa,{mnesia_sup,start_event,[]}},
{restart_type,permanent},
{shutdown,30000},
{child_type,worker}]
Mnesia(nonode@nohost): mnesia_monitor starting: <0.60.0>
Mnesia(nonode@nohost): Mnesia debug level set to verbose

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.60.0>},
{name,mnesia_monitor},
{mfa,{mnesia_monitor,start,[]}},
{restart_type,permanent},
{shutdown,3000},
{child_type,worker}]
Mnesia(nonode@nohost): mnesia_subscr starting: <0.61.0>

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.61.0>},
{name,mnesia_subscr},
{mfa,{mnesia_subscr,start,[]}},
{restart_type,permanent},
{shutdown,3000},
{child_type,worker}]
Mnesia(nonode@nohost): mnesia_locker starting: <0.62.0>

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.62.0>},
{name,mnesia_locker},
{mfa,{mnesia_locker,start,[]}},
{restart_type,permanent},
{shutdown,3000},
{child_type,worker}]
Mnesia(nonode@nohost): mnesia_recover starting: <0.63.0>

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.63.0>},
{name,mnesia_recover},
{mfa,{mnesia_recover,start,[]}},
{restart_type,permanent},
{shutdown,180000},
{child_type,worker}]
Mnesia(nonode@nohost): mnesia_tm starting: <0.64.0>
Mnesia(nonode@nohost): Schema initiated from: default

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,kernel_safe_sup}
started: [{pid,<0.65.0>},
{name,timer_server},
{mfa,{timer,start_link,[]}},
{restart_type,permanent},
{shutdown,1000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.64.0>},
{name,mnesia_tm},
{mfa,{mnesia_tm,start,[]}},
{restart_type,permanent},
{shutdown,30000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.66.0>},
{name,mnesia_checkpoint_sup},
{mfa,{mnesia_checkpoint_sup,start,[]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.67.0>},
{name,mnesia_snmp_sup},
{mfa,{mnesia_snmp_sup,start,[]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]
Mnesia(nonode@nohost): mnesia_controller starting: <0.68.0>

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.68.0>},
{name,mnesia_controller},
{mfa,{mnesia_controller,start,[]}},
{restart_type,permanent},
{shutdown,3000},
{child_type,worker}]
Mnesia(nonode@nohost): mnesia_late_loader starting: <0.69.0>
Mnesia(nonode@nohost): Intend to load tables: []

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.69.0>},
{name,mnesia_late_loader},
{mfa,{mnesia_late_loader,start,[]}},
{restart_type,permanent},
{shutdown,3000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_sup}
started: [{pid,<0.59.0>},
{name,mnesia_kernel_sup},
{mfa,{mnesia_kernel_sup,start,[]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]
ok
=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
application: mnesia
started_at: nonode@nohost
Mnesia(nonode@nohost): Mnesia started, 0 seconds

4> mnesia:change_table_copy_type (schema, node (), disc_copies).
Mnesia(nonode@nohost): Create Directory "/usr/local/work/projects/
first_mnesia/src/Mnesia.nonode@nohost"

=PROGRESS REPORT==== 16-Jul-2008::13:28:25 ===
supervisor: {local,kernel_safe_sup}
started: [{pid,<0.73.0>},
{name,disk_log_sup},
{mfa,{disk_log_sup,start_link,[]}},
{restart_type,permanent},
{shutdown,1000},
{child_type,supervisor}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:25 ===
supervisor: {local,kernel_safe_sup}
started: [{pid,<0.74.0>},
{name,disk_log_server},
{mfa,{disk_log_server,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:25 ===
supervisor: {local,kernel_safe_sup}
started: [{pid,<0.77.0>},
{name,dets_sup},
{mfa,{dets_sup,start_link,[]}},
{restart_type,permanent},
{shutdown,1000},
{child_type,supervisor}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:25 ===
supervisor: {local,kernel_safe_sup}
started: [{pid,<0.78.0>},
{name,dets},
{mfa,{dets_server,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]
{atomic,ok}
5> mnesia:create_table (testtab, [ { type, { external, ordered_set,
tcbdbtab } }, { external_copies, [ node () ] }, { user_properties,
[ { deflate, true }, { bucket_array_size, 10000 } ] } ]).
(<0.60.0>) call tcbdbtab:create_table(testtab,{cstruct,testtab,
{external,ordered_set,tcbdbtab},
[],
[],
[],
[nonode@nohost],
0,
read_write,
[],
[],
false,
testtab,
[key,val],
[{bucket_array_size,10000},{deflate,true}],
[],
{{1216,182517,6509},nonode@nohost},
{{2,0},[]}})
(<0.60.0>) call tcbdbtab:create_table(testtab,{cstruct,testtab,
{external,ordered_set,tcbdbtab},
[],
[],
[],
[nonode@nohost],
0,
read_write,
[],
[],
false,
testtab,
[key,val],
[{bucket_array_size,10000},{deflate,true}],
[],
{{1216,182517,6509},nonode@nohost},
{{2,0},[]}},"testtab.tcb")
(<0.91.0>) call tcbdbtab:delete_table(testtab)
{aborted,{no_exists,{testtab,cstruct}}}(<0.91.0>) call
tcbdbtab:get_port(testtab)

Mnesia(nonode@nohost): <0.91.0> ([]) val(mnesia_gvar,
{testtab,tcbdb_port}) -> {badarg,

[{ets,

lookup_element,

[mnesia_gvar,

{testtab,

tcbdb_port},

2]},

{mnesia_lib,

val,

1},

{tcbdbtab,

get_port,

1},

{tcbdbtab,

delete_table,

1},

{mnesia_schema,

undo_prepare_commit,

2},

{mnesia_tm,

do_abort,

2},

{mnesia_tm,

multi_commit,

4},

{mnesia_tm,

apply_fun,

3}]} {no_exists,

{testtab,

tcbdb_port}}
6> Mnesia(nonode@nohost): <0.91.0> ([]) val(mnesia_gvar,
{testtab,cstruct}) -> {badarg,

[{ets,

lookup_element,

[mnesia_gvar,

{testtab,

cstruct},

2]},

{mnesia_lib,

val,

1},

{tcbdbtab,

get_port,

1},

{tcbdbtab,

delete_table,

1},

{mnesia_schema,

undo_prepare_commit,

2},

{mnesia_tm,

do_abort,

2},

{mnesia_tm,

multi_commit,

4},

{mnesia_tm,

apply_fun,

3}]} {no_exists,

{testtab,

cstruct}}


^C[bwhite@localhost src]$ erl -boot start_sasl -mnesia debug verbose
Erlang (BEAM) emulator version 5.5.5 [source] [64-bit] [async-threads:
0] [hipe] [kernel-poll:false]


=PROGRESS REPORT==== 16-Jul-2008::13:26:59 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.33.0>},
{name,alarm_handler},
{mfa,{alarm_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:26:59 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.34.0>},
{name,overload},
{mfa,{overload,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:26:59 ===
supervisor: {local,sasl_sup}
started: [{pid,<0.32.0>},
{name,sasl_safe_sup},
{mfa,
{supervisor,
start_link,
[{local,sasl_safe_sup},sasl,safe]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]

=PROGRESS REPORT==== 16-Jul-2008::13:26:59 ===
supervisor: {local,sasl_sup}
started: [{pid,<0.35.0>},
{name,release_handler},
{mfa,{release_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:26:59 ===
application: sasl
started_at: nonode@nohost
Eshell V5.5.5 (abort with ^G)
1>
1> dbg:tracer (), dbg:p (all, [ call ]), dbg:tpl (tcbdbtab, dbg:fun2ms
(fun
1> (_) -> return_trace () end)).
{ok,[{matched,nonode@nohost,27},{saved,1}]}
2> tcerl:start ().

=PROGRESS REPORT==== 16-Jul-2008::13:28:10 ===
supervisor: {local,tcerlsup}
started: [{pid,<0.51.0>},
{name,tcbdbsrv},
{mfa,{tcbdbsrv,start_link,[]}},
{restart_type,permanent},
{shutdown,5000},
{child_type,worker}]
ok
=PROGRESS REPORT==== 16-Jul-2008::13:28:10 ===
application: tcerl
started_at: nonode@nohost

3> mnesia:start ().

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_sup}
started: [{pid,<0.58.0>},
{name,mnesia_event},
{mfa,{mnesia_sup,start_event,[]}},
{restart_type,permanent},
{shutdown,30000},
{child_type,worker}]
Mnesia(nonode@nohost): mnesia_monitor starting: <0.60.0>
Mnesia(nonode@nohost): Mnesia debug level set to verbose

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.60.0>},
{name,mnesia_monitor},
{mfa,{mnesia_monitor,start,[]}},
{restart_type,permanent},
{shutdown,3000},
{child_type,worker}]
Mnesia(nonode@nohost): mnesia_subscr starting: <0.61.0>

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.61.0>},
{name,mnesia_subscr},
{mfa,{mnesia_subscr,start,[]}},
{restart_type,permanent},
{shutdown,3000},
{child_type,worker}]
Mnesia(nonode@nohost): mnesia_locker starting: <0.62.0>

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.62.0>},
{name,mnesia_locker},
{mfa,{mnesia_locker,start,[]}},
{restart_type,permanent},
{shutdown,3000},
{child_type,worker}]
Mnesia(nonode@nohost): mnesia_recover starting: <0.63.0>

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.63.0>},
{name,mnesia_recover},
{mfa,{mnesia_recover,start,[]}},
{restart_type,permanent},
{shutdown,180000},
{child_type,worker}]
Mnesia(nonode@nohost): mnesia_tm starting: <0.64.0>
Mnesia(nonode@nohost): Schema initiated from: default

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,kernel_safe_sup}
started: [{pid,<0.65.0>},
{name,timer_server},
{mfa,{timer,start_link,[]}},
{restart_type,permanent},
{shutdown,1000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.64.0>},
{name,mnesia_tm},
{mfa,{mnesia_tm,start,[]}},
{restart_type,permanent},
{shutdown,30000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.66.0>},
{name,mnesia_checkpoint_sup},
{mfa,{mnesia_checkpoint_sup,start,[]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.67.0>},
{name,mnesia_snmp_sup},
{mfa,{mnesia_snmp_sup,start,[]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]
Mnesia(nonode@nohost): mnesia_controller starting: <0.68.0>

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.68.0>},
{name,mnesia_controller},
{mfa,{mnesia_controller,start,[]}},
{restart_type,permanent},
{shutdown,3000},
{child_type,worker}]
Mnesia(nonode@nohost): mnesia_late_loader starting: <0.69.0>
Mnesia(nonode@nohost): Intend to load tables: []

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_kernel_sup}
started: [{pid,<0.69.0>},
{name,mnesia_late_loader},
{mfa,{mnesia_late_loader,start,[]}},
{restart_type,permanent},
{shutdown,3000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
supervisor: {local,mnesia_sup}
started: [{pid,<0.59.0>},
{name,mnesia_kernel_sup},
{mfa,{mnesia_kernel_sup,start,[]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]
ok
=PROGRESS REPORT==== 16-Jul-2008::13:28:18 ===
application: mnesia
started_at: nonode@nohost
Mnesia(nonode@nohost): Mnesia started, 0 seconds

4> mnesia:change_table_copy_type (schema, node (), disc_copies).
Mnesia(nonode@nohost): Create Directory "/usr/local/work/projects/
first_mnesia/src/Mnesia.nonode@nohost"

=PROGRESS REPORT==== 16-Jul-2008::13:28:25 ===
supervisor: {local,kernel_safe_sup}
started: [{pid,<0.73.0>},
{name,disk_log_sup},
{mfa,{disk_log_sup,start_link,[]}},
{restart_type,permanent},
{shutdown,1000},
{child_type,supervisor}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:25 ===
supervisor: {local,kernel_safe_sup}
started: [{pid,<0.74.0>},
{name,disk_log_server},
{mfa,{disk_log_server,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:25 ===
supervisor: {local,kernel_safe_sup}
started: [{pid,<0.77.0>},
{name,dets_sup},
{mfa,{dets_sup,start_link,[]}},
{restart_type,permanent},
{shutdown,1000},
{child_type,supervisor}]

=PROGRESS REPORT==== 16-Jul-2008::13:28:25 ===
supervisor: {local,kernel_safe_sup}
started: [{pid,<0.78.0>},
{name,dets},
{mfa,{dets_server,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
{child_type,worker}]
{atomic,ok}
5> mnesia:create_table (testtab, [ { type, { external, ordered_set,
tcbdbtab } }, { external_copies, [ node () ] }, { user_properties,
[ { deflate, true }, { bucket_array_size, 10000 } ] } ]).
(<0.60.0>) call tcbdbtab:create_table(testtab,{cstruct,testtab,
{external,ordered_set,tcbdbtab},
[],
[],
[],
[nonode@nohost],
0,
read_write,
[],
[],
false,
testtab,
[key,val],
[{bucket_array_size,10000},{deflate,true}],
[],
{{1216,182517,6509},nonode@nohost},
{{2,0},[]}})
(<0.60.0>) call tcbdbtab:create_table(testtab,{cstruct,testtab,
{external,ordered_set,tcbdbtab},
[],
[],
[],
[nonode@nohost],
0,
read_write,
[],
[],
false,
testtab,
[key,val],
[{bucket_array_size,10000},{deflate,true}],
[],
{{1216,182517,6509},nonode@nohost},
{{2,0},[]}},"testtab.tcb")
(<0.91.0>) call tcbdbtab:delete_table(testtab)
{aborted,{no_exists,{testtab,cstruct}}}(<0.91.0>) call
tcbdbtab:get_port(testtab)

Mnesia(nonode@nohost): <0.91.0> ([]) val(mnesia_gvar,
{testtab,tcbdb_port}) -> {badarg,

[{ets,

lookup_element,

[mnesia_gvar,

{testtab,

tcbdb_port},

2]},

{mnesia_lib,

val,

1},

{tcbdbtab,

get_port,

1},

{tcbdbtab,

delete_table,

1},

{mnesia_schema,

undo_prepare_commit,

2},

{mnesia_tm,

do_abort,

2},

{mnesia_tm,

multi_commit,

4},

{mnesia_tm,

apply_fun,

3}]} {no_exists,

{testtab,

tcbdb_port}}
6> Mnesia(nonode@nohost): <0.91.0> ([]) val(mnesia_gvar,
{testtab,cstruct}) -> {badarg,

[{ets,

lookup_element,

[mnesia_gvar,

{testtab,

cstruct},

2]},

{mnesia_lib,

val,

1},

{tcbdbtab,

get_port,

1},

{tcbdbtab,

delete_table,

1},

{mnesia_schema,

undo_prepare_commit,

2},

{mnesia_tm,

do_abort,

2},

{mnesia_tm,

multi_commit,

4},

{mnesia_tm,

apply_fun,

3}]} {no_exists,

{testtab,

cstruct}}

<-- RESULTS NO testtab.tcp -->
[bwhite@localhost Mnesia.nonode@nohost]$ ls -ltr
total 20
-rw-rw-r-- 1 bwhite bwhite 8328 2008-07-16 13:28 schema.DAT
-rw-rw-r-- 1 bwhite bwhite 95 2008-07-16 13:28 LATEST.LOG
-rw-rw-r-- 1 bwhite bwhite 156 2008-07-16 13:28 DECISION_TAB.LOG

Interestingly, if I pull out the create_table/3 function to a separate
file and run it, it does result in the creation of testtab.tcb. So
that means the trouble is after that?

% from tcbdbtab.erl

create_table (Tab, Cs, FileName) ->
Dir = mnesia_lib:val (dir),
{ _, Type, _ } = Cs#cstruct.type,
UserProps = [ case X of { Foo, true } when Foo =:= uncompressed
orelse
Foo =:= deflate orelse
Foo =:= tcbs -> Foo;
_ -> X
end || X <- Cs#cstruct.user_properties ],
File = filename:join ([ Dir, FileName ]),
{ ok, Port } = tcbdbets:open_file ([ { access, read_write },
{ file, File },
{ keypos, 2 },
{ type, Type } ]
++ UserProps),
tcbdbets:unlink (Port),
mnesia_lib:set ({ Tab, tcbdb_port }, Port),
Tab.

do_test()->
create_table(testtab,{cstruct,testtab,
{external,ordered_set,tcbdbtab},
[],
[],
[],
[nonode@nohost],
0,
read_write,
[],
[],
false,
testtab,
[key,val],
[{bucket_array_size,10000},{deflate,true}],
[],
{{1216,180226,830519},nonode@nohost},
{{2,0},[]}},"testtab.tcb").

Regards,

Bruce

paul mineiro

unread,
Jul 16, 2008, 8:24:25 PM7/16/08
to mnesiaex-discuss
tcerl is starting ok so you're finding the linked-in driver ok.

the { error, badarg } stuff is harmless, it's trying to delete the
table and there is no table so looking up the cstruct fails.

so mostly that was uninformative.

you're basically in the "erlang debugging zone", and traces are your
friend. (however do not post all the gory details to the list, it'll
be way too much stuff).

i'm not sure if your copy-paste is messed up or what but i'm still not
seeing return values from the calls into tcbdbtab so that still says
to me an exception is being thrown somewhere in the downward call-
stack of the create_table. so try tracing tcbdbets next and try to
find out where execution stops.

-- p

Bruce

unread,
Jul 17, 2008, 3:00:31 AM7/17/08
to mnesiaex-discuss
FYI,

The issue seems to be related to the fact that my company uses a
patched version of the ERT. When I used a stock ERT 11B5, the problem
went away.

I'm now trying to find which particular patch caused the problem and
how to fix it.

Regards,

Bruce
Reply all
Reply to author
Forward
0 new messages