Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL] Foreign key check doesn't set ROW_MARK_KEYSHARE rowmark #6151

Closed
d-uspenskiy opened this issue Oct 26, 2020 · 0 comments
Closed

[YSQL] Foreign key check doesn't set ROW_MARK_KEYSHARE rowmark #6151

d-uspenskiy opened this issue Oct 26, 2020 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug

Comments

@d-uspenskiy
Copy link
Contributor

It was found that read RPC for FK check comes without rowmark field:

I1021 01:49:10.540298 11423 tablet_service.cc:1707] Received Read RPC: tablet_id: "9b31c78009394c6fa06bc89931da189e"
include_trace: false                  
consistency_level: STRONG             
transaction {                         
  transaction_id: "[\260\256\264Gz@R\222g\310\003\033\221_\327"
  isolation: SNAPSHOT_ISOLATION 
  status_tablet: "dd76b6ef50bd4e4b92c84bd4dbe3e0f9"
  priority: 10287815725710478686
  start_hybrid_time: 6566891317279817728
}                                     
propagated_hybrid_time: 6566891317411524608
read_time {                           
  read_ht: 6566891317279817728  
  local_limit_ht: 6566891317484617728
  global_limit_ht: 6566891317484617728
  in_txn_limit_ht: 6566891317406429184
}                                     
pgsql_batch {                         
  client: YQL_CLIENT_PGSQL      
  stmt_id: 54887024                   
  schema_version: 0                   
  hash_code: 4624                     
  targets {                           
    column_id: -8                     
  }                                   
  table_id: "000030a9000030008000000000004001"
  ybctid_column_value {               
    value {                           
      binary_value: "G\022\020H\200\000\000\001!!"
    }                                 
  }                                   
  batch_arguments {                   
    order: 0                          
    ybctid {                          
      value {                         
        binary_value: "G\022\020H\200\000\000\001!!"
      }                               
    }                                 
  }                                   
  unknown_ybctid_allowed: true   
}                                     
proxy_uuid: ""                        
DEPRECATED_may_have_metadata: true
rejection_score: 0                    
batch_idx: 18446744073709551615
@d-uspenskiy d-uspenskiy added the kind/bug This issue is a bug label Oct 26, 2020
@d-uspenskiy d-uspenskiy self-assigned this Oct 26, 2020
@m-iancu m-iancu added the area/ysql Yugabyte SQL (YSQL) label Oct 28, 2020
d-uspenskiy added a commit that referenced this issue Nov 9, 2020
Summary:
In spite of the fact `FetchExistingYbctids` function sets `rowmark` to `ROW_MARK_KEYSHARE` the read RPC request has empty rowmark.
The reason is that `PgDocReadOp` clones `template_op_` to create actual read requests. It is done in the `PopulateDmlByYbctidOps` method. So setting `rowmark` in `template_op_` object after this point will not affects actual read RPC as it is already cloned from `template_op_`.

Solution is to set `rowmark` before call of the `PopulateDmlByYbctidOps`.
Setting `rowmark` and other parameters in case operations are already cloned from `template_op_` object will now raise an error.

On the `t-server` side changes was done to add necessary intents in case of batched ybctid request.

Test Plan:
Jenkins
```
./yb_build.sh --java-test org.yb.pgsql.TestPgForeignKey
```

Reviewers: neil, alex, sudheer

Reviewed By: sudheer

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D9795
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug
Projects
None yet
Development

No branches or pull requests

2 participants