Giter Site home page Giter Site logo

infinyon / fluvio Goto Github PK

View Code? Open in Web Editor NEW
2.6K 37.0 191.0 23.94 MB

Lean and mean distributed stream processing system written in rust and web assembly.

Home Page: https://www.fluvio.io/

License: Apache License 2.0

Makefile 0.87% Rust 94.00% Shell 5.06% Dockerfile 0.05% Liquid 0.02%
cloud-native streaming rust real-time serverless stateful stream-processing webassembly data-integration data-flow

fluvio's People

Contributors

afourcat avatar ajhunyady avatar crajcan avatar daveatdart avatar davidbeesley avatar dependabot[bot] avatar digikata avatar estebanborai avatar fraidev avatar galibey avatar gregwebs avatar joshchngs avatar kranfix avatar matheus-consoli avatar mfdorst avatar morenol avatar nacardin avatar nicholastmosher avatar ozgrakkurt avatar pinkforest avatar qrilka avatar ryanmtate avatar sehz avatar shylock-hg avatar simlay avatar suptejas avatar tanngocdo avatar tjtelan avatar vijaylaxmid avatar xxchan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fluvio's Issues

Support for TLS

External public API should use TLS.

Components impacted: API (Node, Rust), CLI, SC, SPU

problem provisioning topic with replica of 2

topic with 2 replica:

kc get partition
NAME      LEADER   FOLLOWERS   STATUS    LSR   HW    EOF   FOLLOWER OFFSETS
test1-0   0        [0 1]       Offline   0     0     0     []
kc get spu
NAME     ID    STATUS   TYPE      PUBLIC HOST                                                            PRIVATE HOST                  PORT
main-0   0     Online   Managed   map[encryption:PLAINTEXT ingress:[map[ip:10.107.159.255]] port:9005]   flv-spg-main-0.flv-spg-main   9006
main-1   1     Online   Managed   map[encryption:PLAINTEXT ingress:[map[ip:10.106.230.223]] port:9005]   flv-spg-main-1.flv-spg-main   9006

seems like SPU-0 received topic with spu 0 as follower other way around

kc logs flv-spg-main-0
20:28:47.481 INFO  flv_spu::config::cli > extracting SPU from: flv-spg-main-0
20:28:47.481 INFO  flv_spu::config::cli > found SPU INDEX ID: 0
20:28:47.481 INFO  flv_spu::config::cli > using sc endpoint from env var: flv-sc-internal.default.svc.cluster.local:9004
20:28:47.482 INFO  flv_spu::config::cli > overriding log base: /tmp/fluvio
20:28:47.482 INFO  flv_spu::config::cli > overriding log size 1Gi
starting spu server (id:0)
SPU Version: 0.3.0 started successfully
20:28:47.482 INFO  flv_spu::services::public > starting SPU: 0 at public service at: 0.0.0.0:9005
20:28:47.482 INFO  flv_spu::services::internal > starting SPU: 0 at internal service at: 0.0.0.0:9006
20:28:47.483 INFO  kf_service::kf_server       > starting event loop for: 0.0.0.0:9006
20:28:47.483 INFO  kf_service::kf_server       > starting event loop for: 0.0.0.0:9005
20:28:56.882 WARN  flv_spu::controllers::leader_replica::connection > replica leader: test1-0 was not found
20:29:56.882 WARN  flv_spu::controllers::leader_replica::connection > replica leader: test1-0 was not found
20:30:56.883 WARN  flv_spu::controllers::leader_replica::connection > replica leader: test1-0 was not found
20:31:56.883 WARN  flv_spu::controllers::leader_replica::connection > replica leader: test1-0 was not found
20:32:56.884 WARN  flv_spu::controllers::leader_replica::connection > replica leader: test1-0 was not found
20:33:56.887 WARN  flv_spu::controllers::leader_replica::connection > replica leader: test1-0 was not found
20:34:56.886 WARN  flv_spu::controllers::leader_replica::connection > replica leader: test1-0 was not found
20:35:56.887 WARN  flv_spu::controllers::leader_replica::connection > replica leader: test1-0 was not found
20:36:56.888 WARN  flv_spu::controllers::leader_replica::connection > replica leader: test1-0 was not found
kc logs flv-spg-main-1
20:28:50.541 INFO  flv_spu::config::cli > extracting SPU from: flv-spg-main-1
20:28:50.541 INFO  flv_spu::config::cli > found SPU INDEX ID: 1
20:28:50.541 INFO  flv_spu::config::cli > using sc endpoint from env var: flv-sc-internal.default.svc.cluster.local:9004
20:28:50.541 INFO  flv_spu::config::cli > overriding log base: /tmp/fluvio
20:28:50.541 INFO  flv_spu::config::cli > overriding log size 1Gi
20:28:50.541 INFO  flv_spu::services::public > starting SPU: 1 at public service at: 0.0.0.0:9005
20:28:50.541 INFO  flv_spu::services::internal > starting SPU: 1 at internal service at: 0.0.0.0:9006
starting spu server (id:1)
SPU Version: 0.3.0 started successfully
20:28:50.542 INFO  kf_service::kf_server       > starting event loop for: 0.0.0.0:9005
20:28:50.543 INFO  kf_service::kf_server       > starting event loop for: 0.0.0.0:9006

Deleting topic should remove associated storage as well.

When topic is being deleted, it should go thru following stages:

  • topic is marked for deletion ( in this case, consume/producer can't be performed). this is similar to pod lifecycle
  • For each SPU (leader/follower), when received topic delete
    • ensure all consumer/leader connections have gracefully shutdown
    • delete local leader/follower replica storage.
  • When a leader receives that all follow replica has been purged, it should send back deleted status for topic.
  • When SC receives, deleted status, it will delete the topic.

CLI: misc cluster install changes

  • change description of the SPU to number of SPU in the cluster install.
  • for local cluster, change launching SPU as: launching SPU (2 of 4)
  • show logs location for SC and SPU for local

built-in installer

built in installer to Fluvio CLI instead of using helm.

Benefits

  • remove one more tool that user need to install
  • better user experience

1.0.0

First production version

DOC: Update CLI

We need to update the CLI documentation on the Fluvio docs website.

Review and update

Required for this issue:

  • consume
  • produce
  • topic
  • profile
  • install
  • update
  • cluster start
  • cluster delete

Future work:

  • cluster spu
  • cluster spg

Topic LIVE-REPLICAS shows spu id 0 (but there is no such SPU installed)

$ ./target/debug/fluvio topic create test -p 1 -r 2
topic "test" created


$  ./target/debug/fluvio topic describe -t test
 Name                    :  test 
 Type                    :  computed 
 Partition Count         :  1 
 Replication Factor      :  2 
 Ignore Rack Assignment  :  - 
 Status                  :  provisioned 
 Reason                  :  - 
 Partition Map               
 -----------------           
     ID      LEADER      REPLICAS          LIVE-REPLICAS 
      0       5003       [5003, 5001]      [0, 5001] 


$  ./target/debug/fluvio spu list
 ID    NAME             STATUS  TYPE    RACK  PUBLIC          PRIVATE 
 5001  custom-spu-5001  online  custom   -    localhost:9010  localhost:9011 
 5002  custom-spu-5002  online  custom   -    localhost:9020  localhost:9021 
 5003  custom-spu-5003  online  custom   -    localhost:9030  localhost:9031 

Change "offset" command description in comsumer

The comment:

./target/debug/fluvio consume -h
...
-o, --offset <integer>             optional, offset, negate offset is relative to end offset (either committed or uncommitted)

should be changed to

./target/debug/fluvio consume -h
...
-o, --offset <integer>      Offsets can be positive or negative. (Syntax for negative offset: --offset="-1")

bug: offline replica is chosen as leader

Steps to reproduce:

Create 2 custom SPU:

kc apply -f k8-util/samples/crd/spu_5001.yaml
 kc apply -f k8-util/samples/crd/spu_5002.yaml

Bring up first SPU

 ./dev-tools/log/debug-spu-min 5001 9005 9006

The SPU list shows only first SPU is up

$ flvd spu list
 ID    NAME          STATUS   TYPE      RACK  PUBLIC          PRIVATE 
 5002  custom-spu-2  Offline  "custom"   -    localhost:9007  localhost:9008 
 5001  custom-spu-1  Online   "custom"   -    localhost:9005  localhost:9006

Now create topic with 2 replicas

flvd partition list
 TOPIC    PARTITION  LEADER  REPLICAS  RESOLUTION  HW  LEO  LSR  FOLLOWER OFFSETS 
 message  0          5001    [5002]    Online      0   0    0    [ReplicaStatus { spu: 5002, hw: -1, leo: -1 }] 

shows that online leader is used

Fluvio SC CLI doesn't work with localhost

Steps to reproduce:

fluvio spu list --sc localhost:9003
error: cannot retrieve spus: Connection refused (os error 61)

Note: IP address works fine

fluvio spu list --sc 127.0.0.1:9003
ID NAME STATUS TYPE RACK PUBLIC PRIVATE
5001 custom-spu-1 online custom - localhost:9005 localhost:9006
5002 custom-spu-2 online custom - localhost:9007 localhost:9008
5003 custom-spu-3 online custom - localhost:9009 localhost:9010

replicas should only contain follower for topic describe

Example:

 Name                    :  test1 
 Type                    :  computed 
 Partition Count         :  1 
 Replication Factor      :  2 
 Ignore Rack Assignment  :  - 
 Status                  :  provisioned 
 Reason                  :  - 
 Partition Map               
 -----------------           
     ID      LEADER      REPLICAS      LIVE-REPLICAS 
      0        0         [0, 1]        [1] 

Live replicas contains follow but replica contain leader and follower. They should be consistent.

If 2 consumers listen for the same topic/partition, only one of them gets messages

Steps to reproduce:

  1. Create topic:
    ./target/debug/fluvio topic create -t my-topic-1 -p 1 -r 2

  2. Create first consumer
    ./target/debug/fluvio consume -t my-topic-1 -p 0 -C

  3. Create second consumer
    ./target/debug/fluvio consume -t my-topic-1 -p 0 -C

  4. Create producer
    ./target/debug/fluvio produce -t my-topic-1 -p 0 -C

type a few lines... only 1 consumer gets the messages.

SPU: implement delay flush

Currently every write incur flush call. Delay flush based on following criteria

  • time
  • number of writes or bytes transferred

Bonus: should be configurable

Question on Developer.md

Hello,
I'm following process in Developer.md now. Seems:

$ ./dev-tools/log/debug-sc-min
./dev-tools/log/debug-sc-min: line 5: /Users/djKooks/workspace/etc/rust/fluvio/dev-tools/log/../../target/debug/sc-k8-server: No such file or directory
...
$ ./dev-tools/log/debug-spu-min 5001 9005 9006                          ⏎
./dev-tools/log/debug-spu-min: line 9: /Users/djKooks/workspace/etc/rust/fluvio/dev-tools/log/../../target/debug/spu-server: No such file or directory
...
$ ./target/debug/fluvio spu list --sc 127.0.0.1:9003                    ⏎
error: IoError(
    Custom {
        kind: ConnectionRefused,
        error: VerboseError {
            source: Os {
                code: 61,
                kind: ConnectionRefused,
                message: "Connection refused",
            },
            message: "could not connect to 127.0.0.1:9003",
        },
    },
)

Is there something wrong in my process?

support local cluster install using cargo install

CLI should perform local cluster installation using cargo install by default.
So fluvio install --local should expand into

cargo install flv-sc-k8-server,
cargo install flv-spu-server

then, it can search binary in the cargo .bin directory. This requires

  • both spu and sc are published in the crates
  • can search binaries in the cargo .bin

It should support --path to specify local fluvio repo path. This will invoke cargo build and search binaries in the target directory.

Enforce MAX BYTES for transferring batch records

Fluvio uses zero copy I/o to transfer records from SPU to client.
Records to need to be limit since maximum bytes can be up to 1G for each segment.

Solution:

  • SPU: Limit transferring file slice. This will create potentially truncated last batch
  • Kf decoder: When decoding DefaultRecords, ignore any batch that can't be decoded
  • Client: Use offset in the last batch to retrieve next batches for streaming cases
  • SPU-SPU: Apply spu-message-size to limit bytes

C Library Client

C based library which can be used by any language.
This means we provide "C" export interface on top of the rust native library.

See: Mesa Link as example

NATS Protocol

Your project is intriguing!

I was looking through your source, and was wondering if you've considered using NATS as a protocol? NATS is lightweight and has cloud native features that would trickle up to making your cli's and operations easier. For a specific example, your users wouldn't need to provision a topic and setup partitions with the cli before sending. You'd also be able to securely provide multi-tenancy from the get-go, which would make it easier to use fluvio in a PaaS/SaaS model.

From an adoption standpoint, you'd be able to reach both the NATS and Kafka ecosystems with the NATS Kafka bridge - best of both worlds. Just a thought....

Full disclosure, I'm a NATS maintainer so have bias, but noticed your project and just wanted to make you aware of NATS.

I wish you luck - we'll be following you guys!

CLI: topic creation should return proper error message

Steps to reproduce in dev

  1. cargo build
  2. create local cluster target/debug/cluster install --local which only creates 1 SPU
  3. create topic fluvio topic create --topic test --replication 2 which requires 2 SPU

This result in error:
topic error 'test2' error

this is not descriptive error. it should return proper error message

High level architecture design

Any high level architecuture desing? I'm interested in contributing this, but it seems there's not enough information about this.

Implement Resync between SC and SPU

Currently, SPU re-connect to SC every 60 seconds to avoid issue with TCP connection. It would better if periodic resync is perform between SC and SPU. if re-sync doesn't not occur, full reconnect will occur

Replica Leaders should be evenly distributed across SPUs

If you add 5 topics, the leader distribution should be spread evenly across SPUs.
In my environment I have 3 SPUs and I created 5 topics with 1 partition and 2 replicas each.

The topics are distributed as follows:
5001 - 3 x leaders
5002 - 2 x leaders
5003 - 0 x leaders

$  ./target/debug/fluvio topic describe
Retrieved 5 out of 5 topics

TOPIC DETAILS
-------------
 Name                    :  stress-test-topic 
 Type                    :  computed 
 Partition Count         :  1 
 Replication Factor      :  2 
 Ignore Rack Assignment  :  yes 
 Status                  :  provisioned 
 Reason                  :  - 
 Partition Map               
 -----------------           
     ID      LEADER      REPLICAS          LIVE-REPLICAS 
      0       5001       [5003, 5001]      [0, 5003] 

TOPIC DETAILS
-------------
 Name                    :  test 
 Type                    :  computed 
 Partition Count         :  1 
 Replication Factor      :  2 
 Ignore Rack Assignment  :  - 
 Status                  :  provisioned 
 Reason                  :  - 
 Partition Map               
 -----------------           
     ID      LEADER      REPLICAS          LIVE-REPLICAS 
      0       5001       [5003, 5001]      [0, 5001] 

TOPIC DETAILS
-------------
 Name                    :  test2 
 Type                    :  computed 
 Partition Count         :  1 
 Replication Factor      :  2 
 Ignore Rack Assignment  :  - 
 Status                  :  provisioned 
 Reason                  :  - 
 Partition Map               
 -----------------           
     ID      LEADER      REPLICAS          LIVE-REPLICAS 
      0       5001       [5001, 5002]      [0, 5002] 

TOPIC DETAILS
-------------
 Name                    :  test3 
 Type                    :  computed 
 Partition Count         :  1 
 Replication Factor      :  2 
 Ignore Rack Assignment  :  - 
 Status                  :  provisioned 
 Reason                  :  - 
 Partition Map               
 -----------------           
     ID      LEADER      REPLICAS          LIVE-REPLICAS 
      0       5002       [5002, 5003]      [0, 5003] 

TOPIC DETAILS
-------------
 Name                    :  test4 
 Type                    :  computed 
 Partition Count         :  1 
 Replication Factor      :  2 
 Ignore Rack Assignment  :  - 
 Status                  :  provisioned 
 Reason                  :  - 
 Partition Map               
 -----------------           
     ID      LEADER      REPLICAS          LIVE-REPLICAS 
      0       5002       [5002, 5003]      [0, 5003] 


 $ ./target/debug/fluvio spu list
 ID    NAME             STATUS  TYPE    RACK  PUBLIC          PRIVATE 
 5001  custom-spu-5001  online  custom   -    localhost:9010  localhost:9011 
 5002  custom-spu-5002  online  custom   -    localhost:9020  localhost:9021 
 5003  custom-spu-5003  online  custom   -    localhost:9030  localhost:9031 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.