Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
奇怪的Cassandra 3.9行为Python中的bool字段没有更新_Python_Cassandra_Datastax - Fatal编程技术网

奇怪的Cassandra 3.9行为Python中的bool字段没有更新

奇怪的Cassandra 3.9行为Python中的bool字段没有更新,python,cassandra,datastax,Python,Cassandra,Datastax,我正在查询更新时间和bool标志,但它根本不起作用?我不知道该怎么处理这个问题,也不知道该如何处理。我花了数小时使用调试器,但我发现它不起作用 查询: update task set start_time = toTimestamp(now()), started = true where id = d6283a7e-5b5c-11e7-98da-00059a3c7a00; 字段start有时是True或False-但通常是False-不知道为什么 完整代码: @classmethod

我正在查询更新时间和bool标志,但它根本不起作用?我不知道该怎么处理这个问题,也不知道该如何处理。我花了数小时使用调试器,但我发现它不起作用

查询:

update task
set start_time = toTimestamp(now()), started = true
where id = d6283a7e-5b5c-11e7-98da-00059a3c7a00;
字段
start
有时是
True
False
-但通常是
False
-不知道为什么

完整代码:

    @classmethod
    def _db_start_task(cls, task_id, parent_task_id, farm_settings):
        assert isinstance(task_id, uuid.UUID)
        assert isinstance(farm_settings, FarmSettings)

        logger = logging.getLogger(__name__)
        session = cls._get_session(farm_settings)
        query_string = '''\
update task
set start_time = toTimestamp(now()), started = true
where id = %(task_id)s;''' % {
'task_id': task_id
}
        logger.debug('Query string is: %s.' % query_string)
        update = SimpleStatement(query_string=query_string,
                                 consistency_level=ConsistencyLevel.QUORUM,
                                 serial_consistency_level=ConsistencyLevel.SERIAL)
        warnings.warn('Statement execution problems is not handled.', UserWarning)
        update_result = session.execute(update, trace=True)

        warnings.warn('Debug code to remove start.', UserWarning)
        select = SimpleStatement(query_string='select start_time, started from task where id = %(task_id)s'  
                                 % { 'task_id': task_id },
                                 consistency_level=ConsistencyLevel.QUORUM,
                                 serial_consistency_level=ConsistencyLevel.SERIAL)
        result_set = session.execute(select)
        if result_set[0].started == False:
            logger.critical('Undefined behavior.')
        warnings.warn('Debug code to remove end.', UserWarning)

        if parent_task_id is not None:
            cls._db_count_started_children_tasks(parent_task_id, farm_settings)

这是那些一致性设置的意外行为


一种可能性是,如果您遇到不可用的错误,并且您的群集是使用或类似的方法配置的。

需要检查它。