Inconsistency in num tuples on table


Hi, @easy i got some trouble at my table,suddenly it can’t be query and i got this error Exception: Exception occurred: java.lang.RuntimeException: TMapDException(error_msg:Inconsistency in num tuples within fragment)
is there a way to repair my table?
thanks :slight_smile:


@rejanuiss I can see that you checked a few other posts on this topic. I’d recommend finding the error in the log and sending that snippet so we can check it out.


Hi @easy, sorry for late replies here is my log . and my table who got error cannot be drop! (1.1 KB)


try a truncate table beforce drop


hi @aznable sorry for late replies, i 'm still got same error


dont worry, i got some locking problem some time ago, and i had to do a truncate before to be able to drop the tables; anyway was a silly suggestion :wink:


is there another way, to solve this haha, cause that’s table have 100 thousands data,.



Don’t want to promise we can solve your issue without having more details but there are a couple of things you can try.

There are two undocumented command in mapdql

\gte <table_name> get table epoch for the specified table
\ste "<table_name new_epoch>" set table epoch for the specified table to specified epoch (NOTE the extra " they are mandatory)

Basically there are little to no guard rails around the \ste command, once you set the epoch on a table to a previous epoch your newer data is gone.

Each time an insert or COPY statement writes data to a table the epoch value increases.

Simple example

mapdql> create table testtable (i1 int);
mapdql> \gte testtable
table epoch is 0
mapdql> insert into testtable values (10);
mapdql> \gte testtable
table epoch is 1
mapdql> insert into testtable values (20);
mapdql> \gte testtable
table epoch is 2
mapdql> insert into testtable values (30);
mapdql> select * from testtable;
mapdql> \gte testtable
table epoch is 3
mapdql> \ste "testtable 2"
table epoch set
mapdql> select * from testtable;

So in your case first you would try a \gte yourtable

if you can determine the current epoch you would then progressively set the epoch to the current value minus 1 until you found you had a working table (to check this run simple query on the table).

Now the likely case is you will not be able to do the simple \gte yourtable as it may well fail with the same tuple inconsistency

If this is the case there is another form of the command that use a tableid format to specify how to step back through the epochs.

Please try the above steps and if they fail, which is likely please include the full log so we can determine the appropriate tableid values for the next option



Hi i 'm still can’t dop this table, and i got this messagesScreenshot%20from%202018-08-23%2011-50-40



The \gte command does not expect a ;

As mentioned in the previous post it is likely that due to the corruption an epoch reset will not be possible without further details from the logs.

Give the gte command another try without the ;. Its likely it will have an issue. If/when it does please attach the log and we can go from there




ohyeah sorry thats’s my fault, but i’m still get same error when do \ste