Skip to content

[Bug]: BUG: 'read incr record invalid' causes the CN to crash. #11957

Closed

Description

@sukki37

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93): https://github.com/matrixorigin/matrixone/commit/02535ea0156d4ab38435f064175c83d78c37bc05
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

default-cn-5khbn-crash.log.zip

{"level":"FATAL","time":"2023/09/28 15:22:54.049461 +0000","name":"cn-service.incrservice","caller":"incrservice/store_sql.go:115","msg":"BUG: read incr record invalid","uuid":"33383364-3261-6530-6166-613335626665","fetch-sql":"select offset, step from mo_increment_columns where table_id = 272389 and col_name = 'task_id' for update","account":0,"table":272389,"col":"task_id","rows":0,"stacktrace":"github.com/matrixorigin/matrixone/pkg/incrservice.(*sqlStore).Allocate.func1\n\t/go/src/github.com/matrixorigin/matrixone/pkg/incrservice/store_sql.go:115\ngithub.com/matrixorigin/matrixone/pkg/sql/compile.(*sqlExecutor).ExecTxn\n\t/go/src/github.com/matrixorigin/matrixone/pkg/sql/compile/sql_executor.go:105\ngithub.com/matrixorigin/matrixone/pkg/incrservice.(*sqlStore).Allocate\n\t/go/src/github.com/matrixorigin/matrixone/pkg/incrservice/store_sql.go:98\ngithub.com/matrixorigin/matrixone/pkg/incrservice.(*allocator).doAllocate\n\t/go/src/github.com/matrixorigin/matrixone/pkg/incrservice/allocator.go:143\ngithub.com/matrixorigin/matrixone/pkg/incrservice.(*allocator).run\n\t/go/src/github.com/matrixorigin/matrixone/pkg/incrservice/allocator.go:130\ngithub.com/matrixorigin/matrixone/pkg/common/stopper.(*Stopper).doRunCancelableTask.func1\n\t/go/src/github.com/matrixorigin/matrixone/pkg/common/stopper/stopper.go:259"}

Expected Behavior

No response

Steps to Reproduce

No response

Additional information

No response

Activity

  1. added
    kind/bug
    on Sep 28, 2023
  2. added this to the 1.0.0 milestone on Sep 28, 2023
  3. fengttt commented on Sep 29, 2023

    @fengttt
    Contributor

    May not be related, but at stopper.go #11964

  4. sukki37 commented on Oct 2, 2023

    @sukki37
    ContributorAuthor

    another scenario is that there is no data in memory, but the query transaction shows 22 blocks

    Explore-logs-2023-10-02 18_32_49.txt

  5. LeftHandCold commented on Oct 3, 2023

    @LeftHandCold
    Collaborator

    The root cause is that ctx has "deadline" before sql exec(), and exec() did not return error, so FATAL

  6. LeftHandCold commented on Oct 3, 2023

    @LeftHandCold
    Collaborator

    Repro steps:
    1: https://github.com/matrixorigin/matrixone/blob/main/pkg/incrservice/store_sql.go#L101
    Add TriggerFault in front of Exec(fetchSQL), then make build & start mo

                                     _, sarg, _ := fault.TriggerFault("lock_deadline")
    				if sarg != "" {
    					logutil.Infof("lock_deadline fault: %s, tableid: %d", sarg, tableID)
    					time.Sleep(10 * time.Second)
    				}
    1. Modify autoIncrement=true in sysbench.yml and start sysbench mixed
    2. select enable_fault_injection(); select add_fault_point('lock_deadline', ':::', 'echo', 0, 'lock_deadline');
  7. LeftHandCold commented on Oct 3, 2023

    @LeftHandCold
    Collaborator

    Adding TriggerFault in lock_op.go/doLock can also reproduce the bug

  8. zhangxu19830126 commented on Oct 7, 2023

    @zhangxu19830126
    Contributor

    fixed

  9. zhangxu19830126 commented on Oct 8, 2023

    @zhangxu19830126
    Contributor

    还有有问题,需要继续看

  10. zhangxu19830126 commented on Oct 10, 2023

    @zhangxu19830126
    Contributor

    本地已经fix了

  11. zhangxu19830126 commented on Oct 11, 2023

    @zhangxu19830126
    Contributor

    fixed

  12. added
    severity/s1
    and removed on Oct 12, 2023
  13. sukki37 commented on Oct 12, 2023

    @sukki37
    ContributorAuthor

    After the upgrade, the issue hasn't reproduced, so we've downgraded it for further observation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s1

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions