You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/04/28 01:43:18 UTC

[GitHub] [iotdb] herowzz opened a new issue #3084: 插入数据出现数据错乱现象

herowzz opened a new issue #3084:
URL: https://github.com/apache/iotdb/issues/3084


   每500ms接收大搞100条数据入库
   存储结构如下
   ```
   root.A.b.b01.min
   root.A.b.b02.min
   root.A.b.b03.min
   ....
   ```
   数据列包括:Time,Contract,Close .....
   客户端用的是cpp-client的session->insertRecord方法
   
   结果经常数据出现`root.A.b.b01.min`里面出现b02的数据,而且存在同样的时间戳
   例如:
   ```
   2021-04-27 10:31:35.000, b01, 2200
   2021-04-27 10:31:35.000, b02, 2700
   ```
   这两条数据竟然都进到了`root.A.b.b01.min`这同一个设备下
   导致后面的查询都出现问题
   我按照
   `select Contract,Close from root.A.b.b01.min where time = 2021-04-27 10:31:35` 出来的结果Contract是b01
   `select Contract,Close from root.A.b.b01.min where time = 2021-04-27 10:31:35 and Contract != 'b01'` 出来的结果Contract是b02
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] herowzz commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
herowzz commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828153856


   ```java
   import java.time.LocalDateTime;
   import java.time.format.DateTimeFormatter;
   import java.util.ArrayList;
   import java.util.List;
   
   import org.apache.iotdb.session.pool.SessionPool;
   import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
   
   import com.gtfutures.gtdata.futures.process.domain.Tick;
   
   import lombok.Getter;
   import lombok.Setter;
   import lombok.extern.slf4j.Slf4j;
   
   @Getter
   @Setter
   @Slf4j
   public class TickDao {
   
   	private SessionPool session;
   	private String name;
   
   	private static List<String> measurements = new ArrayList<>();
   	private static List<TSDataType> types = new ArrayList<>();
   
   	public TickDao(String name) {
   		this.name = name;
   	}
   
   	static {
   		measurements.add("Exchange");
   		measurements.add("Varity");
   		measurements.add("Contract");
   		measurements.add("Close");
   		measurements.add("Open");
   		measurements.add("High");
   		measurements.add("Low");
   		measurements.add("Volume");
   		measurements.add("Turnover");
   		measurements.add("TotalVolume");
   		measurements.add("TotalTurnover");
   		measurements.add("OpenInterest");
   		measurements.add("OpenInterestDiff");
   		measurements.add("OpenPosition");
   		measurements.add("ClosePosition");
   		measurements.add("LongShort");
   		measurements.add("Direction");
   		measurements.add("Change");
   		measurements.add("UpLimit");
   		measurements.add("DownLimit");
   
   		measurements.add("BidPrice1");
   		measurements.add("BidVolume1");
   		measurements.add("AskPrice1");
   		measurements.add("AskVolume1");
   
   		measurements.add("BidPrice2");
   		measurements.add("BidVolume2");
   		measurements.add("AskPrice2");
   		measurements.add("AskVolume2");
   
   		measurements.add("BidPrice3");
   		measurements.add("BidVolume3");
   		measurements.add("AskPrice3");
   		measurements.add("AskVolume3");
   
   		measurements.add("BidPrice4");
   		measurements.add("BidVolume4");
   		measurements.add("AskPrice4");
   		measurements.add("AskVolume4");
   
   		measurements.add("BidPrice5");
   		measurements.add("BidVolume5");
   		measurements.add("AskPrice5");
   		measurements.add("AskVolume5");
   
   		measurements.add("PreSettlement");
   		measurements.add("PreClose");
   		measurements.add("PreOpenInterest");
   		measurements.add("HisMax");
   		measurements.add("HisMin");
   		measurements.add("PreDelta");
   		measurements.add("Delta");
   		measurements.add("BidLot");
   		measurements.add("AskLot");
   
   		measurements.add("UpdateTime");
   
   		types.add(TSDataType.TEXT);
   		types.add(TSDataType.TEXT);
   		types.add(TSDataType.TEXT);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.FLOAT);
   
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.FLOAT);
   		types.add(TSDataType.INT64);
   		types.add(TSDataType.INT64);
   
   		types.add(TSDataType.TEXT);
   	}
   
   	public void save(Tick tick) {
   		try {
   			List<Object> values = new ArrayList<>();
   			values.add(tick.getExchange());
   			values.add(tick.getVarity());
   			values.add(tick.getContract());
   			values.add(tick.getLast());
   			values.add(tick.getOpen());
   			values.add(tick.getHigh());
   			values.add(tick.getLow());
   			values.add(tick.getVolume());
   			values.add(tick.getTurnover());
   			values.add(tick.getTotalVolume());
   			values.add(tick.getTotalTurnover());
   			values.add(tick.getOpenInterest());
   			values.add(tick.getOpenInterestDiff());
   			values.add(tick.getOpenPosition());
   			values.add(tick.getClosePosition());
   			values.add(tick.getLongShort());
   			values.add(tick.getDirection());
   			values.add(tick.getChange());
   			values.add(tick.getUpLimit());
   			values.add(tick.getDownLimit());
   
   			values.add(tick.getBidPrice1());
   			values.add(tick.getBidVolume1());
   			values.add(tick.getAskPrice1());
   			values.add(tick.getAskVolume1());
   
   			values.add(tick.getBidPrice2());
   			values.add(tick.getBidVolume2());
   			values.add(tick.getAskPrice2());
   			values.add(tick.getAskVolume2());
   
   			values.add(tick.getBidPrice3());
   			values.add(tick.getBidVolume3());
   			values.add(tick.getAskPrice3());
   			values.add(tick.getAskVolume3());
   
   			values.add(tick.getBidPrice4());
   			values.add(tick.getBidVolume4());
   			values.add(tick.getAskPrice4());
   			values.add(tick.getAskVolume4());
   
   			values.add(tick.getBidPrice5());
   			values.add(tick.getBidVolume5());
   			values.add(tick.getAskPrice5());
   			values.add(tick.getAskVolume5());
   
   			values.add(tick.getPreSettlement());
   			values.add(tick.getPreClose());
   			values.add(tick.getPreOpenInterest());
   			values.add(tick.getHisMax());
   			values.add(tick.getHisMin());
   			values.add(tick.getPreDelta());
   			values.add(tick.getDelta());
   			values.add(tick.getBidLot());
   			values.add(tick.getAskLot());
   			values.add(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS")));
   
   			session.insertRecord("root." + tick.getCode() + ".tick", tick.getDateTimeStamp(), measurements, types, values);
   
   		} catch (Exception e) {
   			log.error("IotDbDao save error!\n{}", tick, e);
   		}
   	}
   
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] qiaojialin removed a comment on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
qiaojialin removed a comment on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828237241


   加个微信吧 qiaojialin1993


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] herowzz edited a comment on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
herowzz edited a comment on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828166790


   > 代码里的`tick.getCode()` 就是上面的b01 、b02、这些值对吧。
   > 有没有可能是这个getCode() 在插入时没有与数据进行对应啊?
   
   tick对象里是局部变量,getCode取的就是exchange + "." + varity + "." + contract
   而DB的Contract列里存的也是contract值
   如果exchange 是MM,varity 是 ag,contract是 ag2101 ,那设备id得到的就是 root.MM.ag.ag2101.tick
   那么就不应该出现root.MM.ag.ag2101.tick存出来一个ag2102的数据
   
   而且,我的设备有 
   root.MM.ag.ag2101.tick
   root.MM.ag.ag2101.min1
   root.MM.ag.ag2101.min10
   root.MM.ag.ag2101.day
   奇怪的是,在这4个设备里面,都重复的出现几百条甚至上千条ag2102的数据,而且重复的数据都一模一样
   也就是说,ag2012的数据重复的数据,分别跑到这些设备里都重复的复制了一份出来
   
   我怀疑有2种可能
   1  是插入问题:在插入的时候,由于什么原因,导致往不同的设备下插入了同样的数据
   2. 是查询问题:如果插入是正常的,会不会存在某种可能,数据其实是正常的,但是由于某种不明的bug,导致我查询root.MM.ag.ag2101.tick的时候,把root.MM.ag.ag2102.tick也查出来了?
       否则为什么会出现,在同一个设备下,会存在同一个时间戳的2条不同数据呢?你们设备下不是同一个时间戳只会有1条数据吗?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
HTHou commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828148713


   可以发一下java的写入程序吗?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
HTHou commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828158969


   代码里的`tick.getCode()` 就是上面的b01 、b02、这些值对吧。
   有没有可能是这个getCode() 在插入时没有与数据进行对应啊?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou edited a comment on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
HTHou edited a comment on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828148713


   可以方便发一下java的写入程序吗?我们试试能不能复现。。。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] herowzz commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
herowzz commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828164228


   ``` java
   @Getter
   @Setter
   @ToString
   public class Tick {
   
   	private LocalDateTime time;
   
   	private String exchange;
   
   	private String varity;
   
   	private String contract;
   
   	private float last;
   
   	private float open;
   
   	private float high;
   
   	private float low;
   
   	private long volume;
   
   	private float turnover;
   
   	private long totalVolume;
   
   	private float totalTurnover;
   
   	private long openInterest;
   
   	private long openInterestDiff;
   
   	private long openPosition;
   
   	private long closePosition;
   
   	private long longShort = -1;
   
   	private long direction = -1;
   
   	private float change;
   
   	private float upLimit;
   
   	private float downLimit;
   
   	private float bidPrice1;
   
   	private long bidVolume1;
   
   	private float askPrice1;
   
   	private long askVolume1;
   
   	private float bidPrice2;
   
   	private long bidVolume2;
   
   	private float askPrice2;
   
   	private long askVolume2;
   
   	private float bidPrice3;
   
   	private long bidVolume3;
   
   	private float askPrice3;
   
   	private long askVolume3;
   
   	private float bidPrice4;
   
   	private long bidVolume4;
   
   	private float askPrice4;
   
   	private long askVolume4;
   
   	private float bidPrice5;
   
   	private long bidVolume5;
   
   	private float askPrice5;
   
   	private long askVolume5;
   
   	private float settlement;
   
   	private float preSettlement;
   
   	private float close;
   
   	private float preClose;
   
   	private long preOpenInterest;
   
   	private float HisMax;
   
   	private float HisMin;
   
   	private float preDelta;
   
   	private float delta;
   
   	private long bidLot;
   
   	private long askLot;
   
   	public long getDateTimeStamp() {
   		return this.time.toInstant(ZoneOffset.of("+8")).toEpochMilli();
   	}
   
   	public void setDateTimeOfTimestamp(long timestamp) {
   		Instant instant = Instant.ofEpochMilli(timestamp);
   		ZoneId zone = ZoneId.systemDefault();
   		this.time = LocalDateTime.ofInstant(instant, zone);
   	}
   
   	public String getCode() {
   		return exchange + "." + varity + "." + contract;
   	}
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] herowzz commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
herowzz commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-829710318


   已将乱序合并关闭,目前收了1天数据没有出现问题


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] herowzz edited a comment on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
herowzz edited a comment on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828153856


   ```java
   session.insertRecord("root." + tick.getCode() + ".tick", tick.getDateTimeStamp(), measurements, types, values);
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] herowzz commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
herowzz commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828143490


   估计跟Cpp客户端没关系,我用Java程序插入,同样还是有问题,应该是服务端的问题


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] qiaojialin commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
qiaojialin commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-834278157


   可以重新拉取 rel/0.12 代码,打开乱序合并测试了


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] herowzz commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
herowzz commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828168819


   > > 我怀疑有2种可能
   > > 1 是插入问题:在插入的时候,由于什么原因,导致往不同的设备下插入了同样的数据
   > > 2. 是查询问题:如果插入是正常的,会不会存在某种可能,数据其实是正常的,但是由于某种不明的bug,导致我查询root.MM.ag.ag2101.tick的时候,把root.MM.ag.ag2102.tick也查出来了?
   > 
   > 我觉得插入程序的可能性更大一些。。。。
   > 这个contract的更新是并发的吗,可以保证它每一行的更新不会有并发问题吗?
   
   不是并发的,一条一条处理的,您有邮箱吗?我可以把我的程序打包发给您


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] qiaojialin commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
qiaojialin commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828237241


   加个微信吧 qiaojialin1993


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] herowzz commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
herowzz commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828092485


   还有奇怪的现象需要说明:
   1. 数据错乱问题只在线上出现,我把数据搜集到文件里,一次性读取插入,无法复现
   2. 比如我27号收的数据,到中午看的时候是正常,但是到下午看的时候又出现了26号0点的数据,问题是27号我才启动的全新数据库,而且0点那条有问题的数据,其他字段从数据库查询出来显示的是NULL,但是我的代码里从来没有写过存NULL的方法
   3. 数据错乱出现时,某一天14点我查询的时候在b01里能查询到b02的数据,但是到了15点之后我又查了一遍,但是错乱的问题又消失了


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou edited a comment on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
HTHou edited a comment on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828170440


   > > > 我怀疑有2种可能
   > > > 1 是插入问题:在插入的时候,由于什么原因,导致往不同的设备下插入了同样的数据
   > > > 2. 是查询问题:如果插入是正常的,会不会存在某种可能,数据其实是正常的,但是由于某种不明的bug,导致我查询root.MM.ag.ag2101.tick的时候,把root.MM.ag.ag2102.tick也查出来了?
   > > 
   > > 
   > > 我觉得插入程序的可能性更大一些。。。。
   > > 这个contract的更新是并发的吗,可以保证它每一行的更新不会有并发问题吗?
   > 
   > 不是并发的,一条一条处理的,您有邮箱吗?我可以把我的程序打包发给您
   
   可以 530444465@qq.com
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] herowzz edited a comment on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
herowzz edited a comment on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828168819


   > > 我怀疑有2种可能
   > > 1 是插入问题:在插入的时候,由于什么原因,导致往不同的设备下插入了同样的数据
   > > 2. 是查询问题:如果插入是正常的,会不会存在某种可能,数据其实是正常的,但是由于某种不明的bug,导致我查询root.MM.ag.ag2101.tick的时候,把root.MM.ag.ag2102.tick也查出来了?
   > 
   > 我觉得插入程序的可能性更大一些。。。。
   > 这个contract的更新是并发的吗,可以保证它每一行的更新不会有并发问题吗?
   
   不是并发的,一条一条处理的


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
HTHou commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-859406861


   https://github.com/apache/iotdb/pull/3391 这个PR应该已经解决了这个问题。rel/0.12最新版本也已经修复了。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou closed issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
HTHou closed issue #3084:
URL: https://github.com/apache/iotdb/issues/3084


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
HTHou commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828168245


   > 我怀疑有2种可能
   > 1 是插入问题:在插入的时候,由于什么原因,导致往不同的设备下插入了同样的数据
   > 2. 是查询问题:如果插入是正常的,会不会存在某种可能,数据其实是正常的,但是由于某种不明的bug,导致我查询root.MM.ag.ag2101.tick的时候,把root.MM.ag.ag2102.tick也查出来了?
   
   我觉得插入程序的可能性更大一些。。。。
   这个contract的更新是并发的吗,可以保证它每一行的更新不会有并发问题吗?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] herowzz commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
herowzz commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828166790


   > 代码里的`tick.getCode()` 就是上面的b01 、b02、这些值对吧。
   > 有没有可能是这个getCode() 在插入时没有与数据进行对应啊?
   
   tick对象里是局部变量,getCode取的就是exchange + "." + varity + "." + contract
   而DB的Contract列里存的也是contract值
   如果exchange 是MM,varity 是 ag,contract是 ag2101 ,那设备id得到的就是 root.MM.ag.ag2101.tick
   那么就不应该出现root.MM.ag.ag2101.tick存出来一个ag2102的数据
   
   而且,我的设备有 
   root.MM.ag.ag2101.tick
   root.MM.ag.ag2101.min1
   root.MM.ag.ag2101.min10
   root.MM.ag.ag2101.day
   奇怪的是,在这4个设备里面,都重复的出现几百条甚至上千条ag2102的数据,而且重复的数据都一模一样
   也就是说,ag2012的数据重复的数据,分别跑到这些设备里都重复的复制了一份出来
   
   我怀疑有2种可能
   1  是插入问题:在插入的时候,由于什么原因,导致往不同的设备下插入了同样的数据
   2. 是查询问题:如果插入是正常的,会不会存在某种可能,数据其实是正常的,但是由于某种不明的bug,导致我查询root.MM.ag.ag2101.tick的时候,把root.MM.ag.ag2102.tick也查出来了?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] herowzz edited a comment on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
herowzz edited a comment on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828164228


   ``` java
   public String getCode() {
   	return exchange + "." + varity + "." + contract;
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] SteveYurongSu commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
SteveYurongSu commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828892486


   这是0.12/0.11乱序文件合并的bug,已经安排修复。
   遇到此问题,可以在iotdb-engine.properties里面将乱序合并关闭:
   ```properties
   # Works when the compaction_strategy is LEVEL_COMPACTION.
   # Whether to merge unseq files into seq files or not.
   enable_unseq_compaction=false
   ```
   此操作不会影响写入性能,在乱序不多的场景下不会影响查询性能。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou removed a comment on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
HTHou removed a comment on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828170440


   > > > 我怀疑有2种可能
   > > > 1 是插入问题:在插入的时候,由于什么原因,导致往不同的设备下插入了同样的数据
   > > > 2. 是查询问题:如果插入是正常的,会不会存在某种可能,数据其实是正常的,但是由于某种不明的bug,导致我查询root.MM.ag.ag2101.tick的时候,把root.MM.ag.ag2102.tick也查出来了?
   > > 
   > > 
   > > 我觉得插入程序的可能性更大一些。。。。
   > > 这个contract的更新是并发的吗,可以保证它每一行的更新不会有并发问题吗?
   > 
   > 不是并发的,一条一条处理的,您有邮箱吗?我可以把我的程序打包发给您
   
   可以 530444465@qq.com
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou commented on issue #3084: 插入数据出现数据错乱现象

Posted by GitBox <gi...@apache.org>.
HTHou commented on issue #3084:
URL: https://github.com/apache/iotdb/issues/3084#issuecomment-828170440


   > > > 我怀疑有2种可能
   > > > 1 是插入问题:在插入的时候,由于什么原因,导致往不同的设备下插入了同样的数据
   > > > 2. 是查询问题:如果插入是正常的,会不会存在某种可能,数据其实是正常的,但是由于某种不明的bug,导致我查询root.MM.ag.ag2101.tick的时候,把root.MM.ag.ag2102.tick也查出来了?
   > > 
   > > 
   > > 我觉得插入程序的可能性更大一些。。。。
   > > 这个contract的更新是并发的吗,可以保证它每一行的更新不会有并发问题吗?
   > 
   > 不是并发的,一条一条处理的,您有邮箱吗?我可以把我的程序打包发给您
   可以 530444465@qq.com
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org